82 lines
1.8 KiB
JavaScript
82 lines
1.8 KiB
JavaScript
// Metro module 3906 (f3907).
|
|
import { useSyncExternalStore, useDebugValue } from "react";
|
|
import { createStore } from "./createStoreImpl_3905";
|
|
function $mk73292($env) {
|
|
return () => {
|
|
const r1 = $env;
|
|
return (0, r1[1])(r1[0].getState());
|
|
};
|
|
}
|
|
function $mk73293($env) {
|
|
return () => {
|
|
const r1 = $env;
|
|
return (0, r1[1])(r1[0].getInitialState());
|
|
};
|
|
}
|
|
function $mk73294($env) {
|
|
return (a0) => {
|
|
let env24893;
|
|
let r4 = a0;
|
|
const r3 = $env.$parent;
|
|
const r2 = $env[0];
|
|
const r6 = env24893 = {};
|
|
env24893[0] = r2;
|
|
if (a0 === void 0) {
|
|
r4 = r3[3];
|
|
}
|
|
env24893[1] = r4;
|
|
const r7 = r3[2];
|
|
const subscribe = r2.subscribe;
|
|
const r9 = $mk73293(r6);
|
|
const syncExternalStore = r7.useSyncExternalStore(subscribe, $mk73292(r6), r9);
|
|
r7.useDebugValue(syncExternalStore);
|
|
return syncExternalStore;
|
|
};
|
|
}
|
|
let createImpl;
|
|
let env2223 = {};
|
|
const identity = (a0) => a0;
|
|
createImpl = (a0) => {
|
|
let env13729;
|
|
const r1 = env13729 = {
|
|
$parent: env2223
|
|
};
|
|
const store = createStore(a0);
|
|
env13729[0] = store;
|
|
const r10 = $mk73294(r1);
|
|
Object.assign(r10, store);
|
|
return r10;
|
|
};
|
|
export const create = (a0) => {
|
|
let r1;
|
|
if (a0) {
|
|
let env13730;
|
|
const r9 = env13730 = {
|
|
$parent: env2223
|
|
};
|
|
const store = createStore(a0);
|
|
env13730[0] = store;
|
|
const r15 = $mk73294(r9);
|
|
Object.assign(r15, store);
|
|
r1 = r15;
|
|
} else {
|
|
r1 = createImpl;
|
|
}
|
|
return r1;
|
|
};
|
|
export function useStore(a0) {
|
|
let env13728;
|
|
const r1 = env13728 = {};
|
|
env13728[0] = a0;
|
|
let r4 = arguments[1];
|
|
if (r4 === void 0) {
|
|
r4 = identity;
|
|
}
|
|
env13728[1] = r4;
|
|
const subscribe = a0.subscribe;
|
|
const r8 = $mk73293(r1);
|
|
const syncExternalStore = useSyncExternalStore(subscribe, $mk73292(r1), r8);
|
|
useDebugValue(syncExternalStore);
|
|
return syncExternalStore;
|
|
}
|