You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
1.8 KiB

{"ast":null,"code":"var _global$contexts;\nimport * as React from 'react';\nvar contexts = '__react_navigation__elements_contexts';\nglobal[contexts] = (_global$contexts = global[contexts]) != null ? _global$contexts : new Map();\nexport default function getNamedContext(name, initialValue) {\n var context = global[contexts].get(name);\n if (context) {\n return context;\n }\n context = React.createContext(initialValue);\n context.displayName = name;\n global[contexts].set(name, context);\n return context;\n}","map":{"version":3,"sources":["getNamedContext.tsx"],"names":["React","contexts","global","Map","getNamedContext","name","initialValue","context","get","createContext","displayName","set"],"mappings":";AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,IAAMC,QAAQ,GAAG,uCAAuC;AAOxDC,MAAM,CAACD,QAAQ,CAAC,uBAAGC,MAAM,CAACD,QAAQ,CAAC,+BAAI,IAAIE,GAAG,EAA8B;AAE5E,eAAe,SAASC,eAAe,CACrCC,IAAY,EACZC,YAAe,EACG;EAClB,IAAIC,OAAO,GAAGL,MAAM,CAACD,QAAQ,CAAC,CAACO,GAAG,CAACH,IAAI,CAAC;EAExC,IAAIE,OAAO,EAAE;IACX,OAAOA,OAAO;EAChB;EAEAA,OAAO,GAAGP,KAAK,CAACS,aAAa,CAAIH,YAAY,CAAC;EAC9CC,OAAO,CAACG,WAAW,GAAGL,IAAI;EAE1BH,MAAM,CAACD,QAAQ,CAAC,CAACU,GAAG,CAACN,IAAI,EAAEE,OAAO,CAAC;EAEnC,OAAOA,OAAO;AAChB","sourceRoot":"../../src","sourcesContent":["import * as React from 'react';\nconst contexts = '__react_navigation__elements_contexts';\n// We use a global variable to keep our contexts so that we can reuse same contexts across packages\nglobal[contexts] = global[contexts] ?? new Map();\nexport default function getNamedContext(name, initialValue) {\n let context = global[contexts].get(name);\n if (context) {\n return context;\n }\n context = /*#__PURE__*/React.createContext(initialValue);\n context.displayName = name;\n global[contexts].set(name, context);\n return context;\n}\n//# sourceMappingURL=getNamedContext.js.map"]},"metadata":{},"sourceType":"module"}