UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

1 lines • 1 kB
{"version":3,"file":"syncNative.js","names":[],"sources":["esm/platform/syncNative.js"],"sourcesContent":["import { getSyncStateInstaller } from \"./syncInstaller\";\nconst GLOBAL_KEY = \"__OneNativeSyncState\";\nfunction getNativeSyncFactory() {\n const globals = globalThis;\n const existing = globals[GLOBAL_KEY];\n if (existing) return existing;\n const installed = getSyncStateInstaller()?.install() ?? false;\n const factory = installed ? globals[GLOBAL_KEY] : void 0;\n if (!factory) {\n throw new Error(\n \"useNativeState requires the OneNative native module (iOS or Android): the sync handle is native-owned.\"\n );\n }\n return factory;\n}\nexport {\n getNativeSyncFactory\n};\n//# sourceMappingURL=syncNative.js.map\n"],"mappings":";;;AACA,MAAM,aAAa;AACnB,SAAS,uBAAuB;CAC9B,MAAM,UAAU;CAChB,MAAM,WAAW,QAAQ;CACzB,IAAI,UAAU,OAAO;CACrB,MAAM,YAAY,sBAAsB,CAAC,EAAE,QAAQ,KAAK;CACxD,MAAM,UAAU,YAAY,QAAQ,cAAc,KAAK;CACvD,IAAI,CAAC,SAAS;EACZ,MAAM,IAAI,MACR,wGACF;CACF;CACA,OAAO;AACT"}