one
Version:
One is a React framework for web, iOS, and Android apps.
18 lines (15 loc) • 600 B
JavaScript
import { getSyncStateInstaller } from "./syncInstaller.mjs";
const GLOBAL_KEY = "__OneNativeSyncState";
function getNativeSyncFactory() {
const globals = globalThis;
const existing = globals[GLOBAL_KEY];
if (existing) return existing;
const installed = getSyncStateInstaller()?.install() ?? false;
const factory = installed ? globals[GLOBAL_KEY] : void 0;
if (!factory) {
throw new Error("useNativeState requires the OneNative native module (iOS or Android): the sync handle is native-owned.");
}
return factory;
}
export { getNativeSyncFactory };
//# sourceMappingURL=syncNative.mjs.map