cross-state 0.53.3 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/diff-BQ8bB3Wk.d.cts +22 -0
- package/dist/diff-gZezL04N.d.ts +22 -0
- package/dist/extendedJson-BZkQBXEv.js +29 -0
- package/dist/extendedJson-BZkQBXEv.js.map +1 -0
- package/dist/extendedJson-Dn2F7Edo.cjs +53 -0
- package/dist/extendedJson-Dn2F7Edo.cjs.map +1 -0
- package/dist/hash-BV06P7va.js +19 -0
- package/dist/hash-BV06P7va.js.map +1 -0
- package/dist/hash-CJPl7SRj.cjs +30 -0
- package/dist/hash-CJPl7SRj.cjs.map +1 -0
- package/dist/index.cjs +49 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/mutative/index.cjs +3 -0
- package/dist/mutative/index.d.cts +3 -0
- package/dist/mutative/index.d.ts +3 -0
- package/dist/mutative/index.js +3 -0
- package/dist/mutative/register.cjs +10 -0
- package/dist/mutative/register.cjs.map +1 -0
- package/dist/mutative/register.d.cts +11 -0
- package/dist/mutative/register.d.ts +9 -0
- package/dist/mutative/register.js +10 -0
- package/dist/mutative/register.js.map +1 -0
- package/dist/mutativeMethods-6QzygG3W.d.cts +13 -0
- package/dist/mutativeMethods-Br3xN2Iq.d.ts +13 -0
- package/dist/mutativeMethods-CZKeRIDL.js +27 -0
- package/dist/mutativeMethods-CZKeRIDL.js.map +1 -0
- package/dist/mutativeMethods-CgXk_bMt.cjs +33 -0
- package/dist/mutativeMethods-CgXk_bMt.cjs.map +1 -0
- package/dist/patchMethods-C3L7Kh8T.d.cts +48 -0
- package/dist/patchMethods-D5YJwcpn.cjs +264 -0
- package/dist/patchMethods-D5YJwcpn.cjs.map +1 -0
- package/dist/patchMethods-DRPfkhAe.js +241 -0
- package/dist/patchMethods-DRPfkhAe.js.map +1 -0
- package/dist/patchMethods-Dxad6HF6.d.ts +48 -0
- package/dist/patches/index.cjs +5 -0
- package/dist/patches/index.d.cts +4 -0
- package/dist/patches/index.d.ts +4 -0
- package/dist/patches/index.js +5 -0
- package/dist/patches/register.cjs +11 -0
- package/dist/patches/register.cjs.map +1 -0
- package/dist/patches/register.d.cts +12 -0
- package/dist/patches/register.d.ts +10 -0
- package/dist/patches/register.js +11 -0
- package/dist/patches/register.js.map +1 -0
- package/dist/persist/register.cjs +13 -0
- package/dist/persist/register.cjs.map +1 -0
- package/dist/persist/register.d.cts +15 -0
- package/dist/persist/register.d.ts +13 -0
- package/dist/persist/register.js +13 -0
- package/dist/persist/register.js.map +1 -0
- package/dist/persist-BluRVcW6.js +258 -0
- package/dist/persist-BluRVcW6.js.map +1 -0
- package/dist/persist-CPjpg6D0.d.ts +61 -0
- package/dist/persist-CztClydq.cjs +263 -0
- package/dist/persist-CztClydq.cjs.map +1 -0
- package/dist/persist-D7MAsyyW.d.cts +61 -0
- package/dist/propAccess-ByqBjC19.cjs +173 -0
- package/dist/propAccess-ByqBjC19.cjs.map +1 -0
- package/dist/propAccess-DGchzVfy.js +113 -0
- package/dist/propAccess-DGchzVfy.js.map +1 -0
- package/dist/react/index.cjs +610 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +305 -0
- package/dist/react/index.d.ts +305 -0
- package/dist/react/index.js +590 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/register.cjs +16 -0
- package/dist/react/register.cjs.map +1 -0
- package/dist/react/register.d.cts +16 -0
- package/dist/react/register.d.ts +14 -0
- package/dist/react/register.js +16 -0
- package/dist/react/register.js.map +1 -0
- package/dist/scope-DI1OFHcr.d.ts +167 -0
- package/dist/scope-DO5vpLPV.d.cts +167 -0
- package/dist/scope-DU5dFP1T.js +322 -0
- package/dist/scope-DU5dFP1T.js.map +1 -0
- package/dist/scope-DvqvkIHB.cjs +369 -0
- package/dist/scope-DvqvkIHB.cjs.map +1 -0
- package/dist/store-BEsiS8y7.d.cts +242 -0
- package/dist/store-BWMWEUpu.cjs +819 -0
- package/dist/store-BWMWEUpu.cjs.map +1 -0
- package/dist/store-DKaeE840.d.ts +242 -0
- package/dist/store-Dr8gM3lq.js +730 -0
- package/dist/store-Dr8gM3lq.js.map +1 -0
- package/dist/storeMethods-AIJSwxHz.js +315 -0
- package/dist/storeMethods-AIJSwxHz.js.map +1 -0
- package/dist/storeMethods-BQwU2Uia.d.cts +107 -0
- package/dist/storeMethods-C4luym7C.d.ts +107 -0
- package/dist/storeMethods-DVVsmUg1.cjs +375 -0
- package/dist/storeMethods-DVVsmUg1.cjs.map +1 -0
- package/package.json +92 -135
- package/dist/cjs/hash.cjs +0 -30
- package/dist/cjs/hash.cjs.map +0 -1
- package/dist/cjs/index.cjs +0 -56
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index2.cjs +0 -300
- package/dist/cjs/index2.cjs.map +0 -1
- package/dist/cjs/mutative/index.cjs +0 -10
- package/dist/cjs/mutative/index.cjs.map +0 -1
- package/dist/cjs/mutative/register.cjs +0 -8
- package/dist/cjs/mutative/register.cjs.map +0 -1
- package/dist/cjs/mutativeMethods.cjs +0 -29
- package/dist/cjs/mutativeMethods.cjs.map +0 -1
- package/dist/cjs/patches/index.cjs +0 -10
- package/dist/cjs/patches/index.cjs.map +0 -1
- package/dist/cjs/patches/register.cjs +0 -8
- package/dist/cjs/patches/register.cjs.map +0 -1
- package/dist/cjs/persist/register.cjs +0 -11
- package/dist/cjs/persist/register.cjs.map +0 -1
- package/dist/cjs/persist.cjs +0 -302
- package/dist/cjs/persist.cjs.map +0 -1
- package/dist/cjs/propAccess.cjs +0 -162
- package/dist/cjs/propAccess.cjs.map +0 -1
- package/dist/cjs/react/index.cjs +0 -628
- package/dist/cjs/react/index.cjs.map +0 -1
- package/dist/cjs/react/register.cjs +0 -13
- package/dist/cjs/react/register.cjs.map +0 -1
- package/dist/cjs/scope.cjs +0 -400
- package/dist/cjs/scope.cjs.map +0 -1
- package/dist/cjs/store.cjs +0 -829
- package/dist/cjs/store.cjs.map +0 -1
- package/dist/cjs/storeMethods.cjs +0 -856
- package/dist/cjs/storeMethods.cjs.map +0 -1
- package/dist/cjs/urlStore.cjs +0 -120
- package/dist/cjs/urlStore.cjs.map +0 -1
- package/dist/es/hash.mjs +0 -27
- package/dist/es/hash.mjs.map +0 -1
- package/dist/es/index.mjs +0 -20
- package/dist/es/index.mjs.map +0 -1
- package/dist/es/index2.mjs +0 -291
- package/dist/es/index2.mjs.map +0 -1
- package/dist/es/mutative/index.mjs +0 -2
- package/dist/es/mutative/index.mjs.map +0 -1
- package/dist/es/mutative/register.mjs +0 -6
- package/dist/es/mutative/register.mjs.map +0 -1
- package/dist/es/mutativeMethods.mjs +0 -27
- package/dist/es/mutativeMethods.mjs.map +0 -1
- package/dist/es/patches/index.mjs +0 -2
- package/dist/es/patches/index.mjs.map +0 -1
- package/dist/es/patches/register.mjs +0 -6
- package/dist/es/patches/register.mjs.map +0 -1
- package/dist/es/persist/register.mjs +0 -9
- package/dist/es/persist/register.mjs.map +0 -1
- package/dist/es/persist.mjs +0 -300
- package/dist/es/persist.mjs.map +0 -1
- package/dist/es/propAccess.mjs +0 -151
- package/dist/es/propAccess.mjs.map +0 -1
- package/dist/es/react/index.mjs +0 -611
- package/dist/es/react/index.mjs.map +0 -1
- package/dist/es/react/register.mjs +0 -11
- package/dist/es/react/register.mjs.map +0 -1
- package/dist/es/scope.mjs +0 -391
- package/dist/es/scope.mjs.map +0 -1
- package/dist/es/store.mjs +0 -812
- package/dist/es/store.mjs.map +0 -1
- package/dist/es/storeMethods.mjs +0 -845
- package/dist/es/storeMethods.mjs.map +0 -1
- package/dist/es/urlStore.mjs +0 -116
- package/dist/es/urlStore.mjs.map +0 -1
- package/dist/types/core/cache.d.ts +0 -119
- package/dist/types/core/commonTypes.d.ts +0 -76
- package/dist/types/core/index.d.ts +0 -6
- package/dist/types/core/resourceGroup.d.ts +0 -16
- package/dist/types/core/scope.d.ts +0 -5
- package/dist/types/core/store.d.ts +0 -86
- package/dist/types/core/urlStore.d.ts +0 -21
- package/dist/types/index.d.ts +0 -14
- package/dist/types/lib/applyPatches.d.ts +0 -2
- package/dist/types/lib/autobind.d.ts +0 -1
- package/dist/types/lib/cacheState.d.ts +0 -20
- package/dist/types/lib/calcDuration.d.ts +0 -2
- package/dist/types/lib/calculatedValue.d.ts +0 -9
- package/dist/types/lib/castArray.d.ts +0 -1
- package/dist/types/lib/clone.d.ts +0 -1
- package/dist/types/lib/constrain.d.ts +0 -1
- package/dist/types/lib/debounce.d.ts +0 -12
- package/dist/types/lib/deferred.d.ts +0 -5
- package/dist/types/lib/diff.d.ts +0 -17
- package/dist/types/lib/disposable.d.ts +0 -3
- package/dist/types/lib/equals.d.ts +0 -3
- package/dist/types/lib/extendedJson.d.ts +0 -5
- package/dist/types/lib/forwardError.d.ts +0 -1
- package/dist/types/lib/hash.d.ts +0 -5
- package/dist/types/lib/helpers.d.ts +0 -2
- package/dist/types/lib/instanceCache.d.ts +0 -18
- package/dist/types/lib/isPromise.d.ts +0 -1
- package/dist/types/lib/makeSelector.d.ts +0 -2
- package/dist/types/lib/maybePromise.d.ts +0 -1
- package/dist/types/lib/path.d.ts +0 -41
- package/dist/types/lib/promiseChain.d.ts +0 -5
- package/dist/types/lib/promiseWithCancel.d.ts +0 -8
- package/dist/types/lib/promiseWithState.d.ts +0 -9
- package/dist/types/lib/propAccess.d.ts +0 -7
- package/dist/types/lib/queue.d.ts +0 -11
- package/dist/types/lib/standardMethods.d.ts +0 -20
- package/dist/types/lib/throttle.d.ts +0 -2
- package/dist/types/lib/trackingProxy.d.ts +0 -2
- package/dist/types/lib/trie.d.ts +0 -11
- package/dist/types/lib/typeHelpers.d.ts +0 -12
- package/dist/types/lib/unwrapPromise.d.ts +0 -1
- package/dist/types/lib/updateHelpers.d.ts +0 -1
- package/dist/types/lib/wildcardMatch.d.ts +0 -3
- package/dist/types/mutative/index.d.ts +0 -1
- package/dist/types/mutative/mutativeMethods.d.ts +0 -11
- package/dist/types/mutative/register.d.ts +0 -7
- package/dist/types/patches/index.d.ts +0 -1
- package/dist/types/patches/patchMethods.d.ts +0 -44
- package/dist/types/patches/register.d.ts +0 -7
- package/dist/types/persist/index.d.ts +0 -3
- package/dist/types/persist/persist.d.ts +0 -40
- package/dist/types/persist/persistPathHelpers.d.ts +0 -6
- package/dist/types/persist/persistStorage.d.ts +0 -17
- package/dist/types/persist/register.d.ts +0 -9
- package/dist/types/react/cacheMethods.d.ts +0 -5
- package/dist/types/react/form/customInput.d.ts +0 -6
- package/dist/types/react/form/form.d.ts +0 -98
- package/dist/types/react/form/formField.d.ts +0 -68
- package/dist/types/react/form/formForEach.d.ts +0 -19
- package/dist/types/react/form/index.d.ts +0 -3
- package/dist/types/react/form/useFormAutosave.d.ts +0 -9
- package/dist/types/react/index.d.ts +0 -11
- package/dist/types/react/loadingBoundary.d.ts +0 -21
- package/dist/types/react/register.d.ts +0 -15
- package/dist/types/react/scope.d.ts +0 -24
- package/dist/types/react/scopeMethods.d.ts +0 -20
- package/dist/types/react/storeMethods.d.ts +0 -15
- package/dist/types/react/useCache.d.ts +0 -34
- package/dist/types/react/useDecoupledState.d.ts +0 -7
- package/dist/types/react/useProp.d.ts +0 -8
- package/dist/types/react/useStore.d.ts +0 -16
- package/dist/types/react/useUrlParamScope.d.ts +0 -4
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"storeMethods.mjs","sources":["../../src/lib/trackingProxy.ts","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/shim/index.js","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js","../../node_modules/.pnpm/use-sync-external-store@1.2.2_react@18.3.1/node_modules/use-sync-external-store/shim/with-selector.js","../../src/react/useStore.ts","../../src/react/loadingBoundary.tsx","../../src/react/useCache.ts","../../src/react/cacheMethods.ts","../../src/react/useProp.ts","../../src/react/scope.tsx","../../src/react/scopeMethods.ts","../../src/react/storeMethods.ts"],"sourcesContent":["import { isPlainObject } from '@lib/helpers';\nimport { deepEqual } from './equals';\n\nconst unwrapProxySymbol = /* @__PURE__ */ Symbol('unwrapProxy');\n\nexport type TrackingProxy<T> = [value: T, equals: (newValue: T) => boolean, revoke?: () => void];\ntype Object_ = Record<string | symbol, unknown>;\n\nexport function trackingProxy<T>(\n value: T,\n equals: (a: any, b: any) => boolean = deepEqual,\n): TrackingProxy<T> {\n if (!isPlainObject(value) && !Array.isArray(value)) {\n return [value, (other) => equals(value, other)];\n }\n\n // Unpack proxies, we don't want to nest them\n value = (value as any)[unwrapProxySymbol] ?? value;\n\n const deps = new Array<TrackingProxy<any>[1]>();\n const revokations = new Array<() => void>();\n let revoked = false;\n\n function trackComplexProp(function_: any, ...args: any[]) {\n const [proxiedValue, equals, revoke] = trackingProxy(function_(value, ...args));\n\n deps.push((otherValue) => {\n if (!isPlainObject(otherValue) && !Array.isArray(otherValue)) {\n return false;\n }\n\n return equals(function_(otherValue, ...args));\n });\n\n if (revoke) {\n revokations.push(revoke);\n }\n\n return proxiedValue;\n }\n\n function trackSimpleProp(function_: any, ...args: any[]) {\n const calculatedValue = function_(value, ...args);\n\n deps.push((otherValue) => {\n return function_(otherValue, ...args) === calculatedValue;\n });\n\n return calculatedValue;\n }\n\n const proxy = new Proxy(value as T & Object_, {\n get(target, p, receiver) {\n if (p === unwrapProxySymbol) {\n return value;\n }\n\n if (revoked) {\n return target[p];\n }\n\n const { writable, configurable } = Object.getOwnPropertyDescriptor(target, p) ?? {};\n if (writable === false && configurable === false) {\n return target[p];\n }\n\n return trackComplexProp(Reflect.get, p, receiver);\n },\n\n getOwnPropertyDescriptor(target, p) {\n const { writable, configurable } = Object.getOwnPropertyDescriptor(target, p) ?? {};\n if (writable === false && configurable === false) {\n return Reflect.getOwnPropertyDescriptor(target, p);\n }\n\n return trackComplexProp(Reflect.getOwnPropertyDescriptor, p);\n },\n\n ownKeys() {\n return trackComplexProp(Reflect.ownKeys);\n },\n\n getPrototypeOf() {\n return trackSimpleProp(Reflect.getPrototypeOf);\n },\n\n has(_target, p) {\n return trackSimpleProp(Reflect.has, p);\n },\n\n isExtensible() {\n return trackSimpleProp(Reflect.isExtensible);\n },\n });\n\n return [\n proxy,\n (other) => !!other && deps.every((equals) => equals(other)),\n () => {\n revoked = true;\n revokations.forEach((revoke) => revoke());\n },\n ];\n}\n","/**\n * @license React\n * use-sync-external-store-shim.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","/**\n * @license React\n * use-sync-external-store-shim.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\n\nvar ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;\n\nfunction error(format) {\n {\n {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n printWarning('error', format, args);\n }\n }\n}\n\nfunction printWarning(level, format, args) {\n // When changing this logic, you might want to also\n // update consoleWithStackDev.www.js as well.\n {\n var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;\n var stack = ReactDebugCurrentFrame.getStackAddendum();\n\n if (stack !== '') {\n format += '%s';\n args = args.concat([stack]);\n } // eslint-disable-next-line react-internal/safe-string-coercion\n\n\n var argsWithFormat = args.map(function (item) {\n return String(item);\n }); // Careful: RN currently depends on this prefix\n\n argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it\n // breaks IE9: https://github.com/facebook/react/issues/13610\n // eslint-disable-next-line react-internal/no-production-logging\n\n Function.prototype.apply.call(console[level], console, argsWithFormat);\n }\n}\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\n// dispatch for CommonJS interop named imports.\n\nvar useState = React.useState,\n useEffect = React.useEffect,\n useLayoutEffect = React.useLayoutEffect,\n useDebugValue = React.useDebugValue;\nvar didWarnOld18Alpha = false;\nvar didWarnUncachedGetSnapshot = false; // Disclaimer: This shim breaks many of the rules of React, and only works\n// because of a very particular set of implementation details and assumptions\n// -- change any one of them and it will break. The most important assumption\n// is that updates are always synchronous, because concurrent rendering is\n// only available in versions of React that also have a built-in\n// useSyncExternalStore API. And we only use this shim when the built-in API\n// does not exist.\n//\n// Do not assume that the clever hacks used by this hook also work in general.\n// The point of this shim is to replace the need for hacks by other libraries.\n\nfunction useSyncExternalStore(subscribe, getSnapshot, // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n// React do not expose a way to check if we're hydrating. So users of the shim\n// will need to track that themselves and return the correct value\n// from `getSnapshot`.\ngetServerSnapshot) {\n {\n if (!didWarnOld18Alpha) {\n if (React.startTransition !== undefined) {\n didWarnOld18Alpha = true;\n\n error('You are using an outdated, pre-release alpha of React 18 that ' + 'does not support useSyncExternalStore. The ' + 'use-sync-external-store shim will not work correctly. Upgrade ' + 'to a newer pre-release.');\n }\n }\n } // Read the current snapshot from the store on every render. Again, this\n // breaks the rules of React, and only works here because of specific\n // implementation details, most importantly that updates are\n // always synchronous.\n\n\n var value = getSnapshot();\n\n {\n if (!didWarnUncachedGetSnapshot) {\n var cachedValue = getSnapshot();\n\n if (!objectIs(value, cachedValue)) {\n error('The result of getSnapshot should be cached to avoid an infinite loop');\n\n didWarnUncachedGetSnapshot = true;\n }\n }\n } // Because updates are synchronous, we don't queue them. Instead we force a\n // re-render whenever the subscribed state changes by updating an some\n // arbitrary useState hook. Then, during render, we call getSnapshot to read\n // the current value.\n //\n // Because we don't actually use the state returned by the useState hook, we\n // can save a bit of memory by storing other stuff in that slot.\n //\n // To implement the early bailout, we need to track some things on a mutable\n // object. Usually, we would put that in a useRef hook, but we can stash it in\n // our useState hook instead.\n //\n // To force a re-render, we call forceUpdate({inst}). That works because the\n // new object always fails an equality check.\n\n\n var _useState = useState({\n inst: {\n value: value,\n getSnapshot: getSnapshot\n }\n }),\n inst = _useState[0].inst,\n forceUpdate = _useState[1]; // Track the latest getSnapshot function with a ref. This needs to be updated\n // in the layout phase so we can access it during the tearing check that\n // happens on subscribe.\n\n\n useLayoutEffect(function () {\n inst.value = value;\n inst.getSnapshot = getSnapshot; // Whenever getSnapshot or subscribe changes, we need to check in the\n // commit phase if there was an interleaved mutation. In concurrent mode\n // this can happen all the time, but even in synchronous mode, an earlier\n // effect may have mutated the store.\n\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }, [subscribe, value, getSnapshot]);\n useEffect(function () {\n // Check for changes right before subscribing. Subsequent changes will be\n // detected in the subscription handler.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n\n var handleStoreChange = function () {\n // TODO: Because there is no cross-renderer API for batching updates, it's\n // up to the consumer of this library to wrap their subscription event\n // with unstable_batchedUpdates. Should we try to detect when this isn't\n // the case and print a warning in development?\n // The store changed. Check if the snapshot changed since the last time we\n // read from the store.\n if (checkIfSnapshotChanged(inst)) {\n // Force a re-render.\n forceUpdate({\n inst: inst\n });\n }\n }; // Subscribe to the store and return a clean-up function.\n\n\n return subscribe(handleStoreChange);\n }, [subscribe]);\n useDebugValue(value);\n return value;\n}\n\nfunction checkIfSnapshotChanged(inst) {\n var latestGetSnapshot = inst.getSnapshot;\n var prevValue = inst.value;\n\n try {\n var nextValue = latestGetSnapshot();\n return !objectIs(prevValue, nextValue);\n } catch (error) {\n return true;\n }\n}\n\nfunction useSyncExternalStore$1(subscribe, getSnapshot, getServerSnapshot) {\n // Note: The shim does not use getServerSnapshot, because pre-18 versions of\n // React do not expose a way to check if we're hydrating. So users of the shim\n // will need to track that themselves and return the correct value\n // from `getSnapshot`.\n return getSnapshot();\n}\n\nvar canUseDOM = !!(typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined');\n\nvar isServerEnvironment = !canUseDOM;\n\nvar shim = isServerEnvironment ? useSyncExternalStore$1 : useSyncExternalStore;\nvar useSyncExternalStore$2 = React.useSyncExternalStore !== undefined ? React.useSyncExternalStore : shim;\n\nexports.useSyncExternalStore = useSyncExternalStore$2;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n\n 'use strict';\n\n/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());\n}\n var React = require('react');\nvar shim = require('use-sync-external-store/shim');\n\n/**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\nfunction is(x, y) {\n return x === y && (x !== 0 || 1 / x === 1 / y) || x !== x && y !== y // eslint-disable-line no-self-compare\n ;\n}\n\nvar objectIs = typeof Object.is === 'function' ? Object.is : is;\n\nvar useSyncExternalStore = shim.useSyncExternalStore;\n\n// for CommonJS interop.\n\nvar useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue; // Same as useSyncExternalStore, but supports selector and isEqual arguments.\n\nfunction useSyncExternalStoreWithSelector(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) {\n // Use this to track the rendered snapshot.\n var instRef = useRef(null);\n var inst;\n\n if (instRef.current === null) {\n inst = {\n hasValue: false,\n value: null\n };\n instRef.current = inst;\n } else {\n inst = instRef.current;\n }\n\n var _useMemo = useMemo(function () {\n // Track the memoized state using closure variables that are local to this\n // memoized instance of a getSnapshot function. Intentionally not using a\n // useRef hook, because that state would be shared across all concurrent\n // copies of the hook/component.\n var hasMemo = false;\n var memoizedSnapshot;\n var memoizedSelection;\n\n var memoizedSelector = function (nextSnapshot) {\n if (!hasMemo) {\n // The first time the hook is called, there is no memoized result.\n hasMemo = true;\n memoizedSnapshot = nextSnapshot;\n\n var _nextSelection = selector(nextSnapshot);\n\n if (isEqual !== undefined) {\n // Even if the selector has changed, the currently rendered selection\n // may be equal to the new selection. We should attempt to reuse the\n // current value if possible, to preserve downstream memoizations.\n if (inst.hasValue) {\n var currentSelection = inst.value;\n\n if (isEqual(currentSelection, _nextSelection)) {\n memoizedSelection = currentSelection;\n return currentSelection;\n }\n }\n }\n\n memoizedSelection = _nextSelection;\n return _nextSelection;\n } // We may be able to reuse the previous invocation's result.\n\n\n // We may be able to reuse the previous invocation's result.\n var prevSnapshot = memoizedSnapshot;\n var prevSelection = memoizedSelection;\n\n if (objectIs(prevSnapshot, nextSnapshot)) {\n // The snapshot is the same as last time. Reuse the previous selection.\n return prevSelection;\n } // The snapshot has changed, so we need to compute a new selection.\n\n\n // The snapshot has changed, so we need to compute a new selection.\n var nextSelection = selector(nextSnapshot); // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n\n // If a custom isEqual function is provided, use that to check if the data\n // has changed. If it hasn't, return the previous selection. That signals\n // to React that the selections are conceptually equal, and we can bail\n // out of rendering.\n if (isEqual !== undefined && isEqual(prevSelection, nextSelection)) {\n return prevSelection;\n }\n\n memoizedSnapshot = nextSnapshot;\n memoizedSelection = nextSelection;\n return nextSelection;\n }; // Assigning this to a constant so that Flow knows it can't change.\n\n\n // Assigning this to a constant so that Flow knows it can't change.\n var maybeGetServerSnapshot = getServerSnapshot === undefined ? null : getServerSnapshot;\n\n var getSnapshotWithSelector = function () {\n return memoizedSelector(getSnapshot());\n };\n\n var getServerSnapshotWithSelector = maybeGetServerSnapshot === null ? undefined : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n };\n return [getSnapshotWithSelector, getServerSnapshotWithSelector];\n }, [getSnapshot, getServerSnapshot, selector, isEqual]),\n getSelection = _useMemo[0],\n getServerSelection = _useMemo[1];\n\n var value = useSyncExternalStore(subscribe, getSelection, getServerSelection);\n useEffect(function () {\n inst.hasValue = true;\n inst.value = value;\n }, [value]);\n useDebugValue(value);\n return value;\n}\n\nexports.useSyncExternalStoreWithSelector = useSyncExternalStoreWithSelector;\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\nif (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' &&\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop ===\n 'function'\n) {\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());\n}\n \n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import type { Selector, SubscribeOptions } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport type { Constrain } from '@lib/constrain';\nimport { deepEqual } from '@lib/equals';\nimport { simpleHash } from '@lib/hash';\nimport { makeSelector } from '@lib/makeSelector';\nimport { type Path, type Value } from '@lib/path';\nimport { trackingProxy } from '@lib/trackingProxy';\nimport { useCallback, useDebugValue, useLayoutEffect, useRef } from 'react';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector.js';\n\nexport interface UseStoreOptions<S> extends Omit<SubscribeOptions, 'runNow' | 'passive'> {\n /**\n * If true, the cache content can be consumed but no fetch will be triggered.\n * @default false\n */\n passive?: boolean;\n\n disableTrackingProxy?: boolean;\n\n withViewTransition?: boolean | ((value: S) => unknown);\n}\n\nexport function useStore<T, S>(\n store: Store<T>,\n selector: Selector<T, S>,\n option?: UseStoreOptions<S>,\n): S;\n\nexport function useStore<T, const P>(\n store: Store<T>,\n selector: Constrain<P, Path<T>>,\n option?: UseStoreOptions<Value<T, P>>,\n): Value<T, P>;\n\nexport function useStore<T>(store: Store<T>, option?: UseStoreOptions<T>): T;\n\nexport function useStore<T, S>(store: Store<T>, argument1?: any, argument2?: any): S {\n const selector = makeSelector<T, S>(\n typeof argument1 === 'function' || typeof argument1 === 'string' ? argument1 : undefined,\n );\n\n const allOptions = (\n typeof argument1 === 'object' ? argument1 : (argument2 ?? {})\n ) as UseStoreOptions<S>;\n\n const lastEqualsRef = useRef<(newValue: S) => boolean>();\n\n if (store.derivedFrom) {\n return useStore(\n store.derivedFrom.store,\n (value) => {\n for (const selector of store.derivedFrom!.selectors) {\n value = makeSelector(selector)(value);\n }\n return selector(value);\n },\n allOptions,\n );\n }\n\n const {\n disableTrackingProxy = true,\n equals = store.options.equals ?? deepEqual,\n withViewTransition,\n ...options\n } = allOptions;\n\n const subOptions = { ...options, runNow: false };\n const subscribe = useCallback(\n (listener: () => void) => {\n let _listener: (value: any) => void = listener;\n let stopped = false;\n\n if (withViewTransition && (document as any).startViewTransition) {\n let lastObservedValue: any;\n\n _listener = (value: any) => {\n const observedValue =\n withViewTransition instanceof Function ? withViewTransition(value) : value;\n\n if (equals(lastObservedValue, observedValue)) {\n listener();\n return;\n }\n\n lastObservedValue = observedValue;\n\n let hasChanges = false;\n const mutationObserver = new MutationObserver(() => {\n hasChanges = true;\n mutationObserver.disconnect();\n });\n mutationObserver.observe(document.body, { childList: true, subtree: true });\n\n (document as any).startViewTransition(() => {\n mutationObserver.disconnect();\n\n if (!stopped) {\n listener();\n }\n\n if (!hasChanges) {\n throw new Error('no change');\n }\n });\n };\n }\n\n const cancel = store.subscribe(_listener, subOptions);\n return () => {\n stopped = true;\n cancel();\n };\n },\n [store, simpleHash(subOptions)],\n );\n\n let value = useSyncExternalStoreWithSelector<T, S>(\n //\n subscribe,\n store.get,\n undefined,\n (x) => selector(x),\n (_v, newValue) => lastEqualsRef.current?.(newValue) ?? false,\n );\n let lastEquals = (newValue: S) => equals(newValue, value);\n let revoke: (() => void) | undefined;\n\n if (!disableTrackingProxy) {\n [value, lastEquals, revoke] = trackingProxy(value, equals);\n }\n\n useLayoutEffect(() => {\n lastEqualsRef.current = lastEquals;\n revoke?.();\n });\n\n useDebugValue(value);\n return value;\n}\n","import { createStore } from '@core';\nimport { useStore } from '@react/useStore';\nimport { createContext, useContext, useLayoutEffect, useMemo, type ReactNode } from 'react';\n\nexport interface LoadingBoundaryEntry {\n label?: ReactNode;\n}\n\nexport interface LoadingBoundaryProps {\n /**\n * Fallback node to render when there are loading components within the boundary.\n */\n fallback?: ReactNode | ((entries: LoadingBoundaryEntry[]) => ReactNode);\n\n /**\n * Child node to render when there are no loading components within the boundary.\n */\n children?: ReactNode;\n\n /**\n * Add a loading state from outside the boundary. Useful for when you want to\n * show a loading state for a component that is not a child of the boundary.\n */\n isLoading?: boolean;\n}\n\nconst LoadingBoundaryContext = createContext(createStore(new Set<LoadingBoundaryEntry>()));\n\nexport function LoadingBoundary({\n fallback,\n children,\n isLoading: isLoadingExternal,\n}: LoadingBoundaryProps): JSX.Element {\n const store = useMemo(() => createStore(new Set<LoadingBoundaryEntry>()), []);\n const entries = useStore(store);\n const isLoading = entries.size > 0 || isLoadingExternal;\n\n const fallbackNode = isLoading\n ? typeof fallback === 'function'\n ? fallback([...entries])\n : fallback\n : undefined;\n\n return (\n <LoadingBoundaryContext.Provider value={store}>\n {fallbackNode !== undefined ? (\n <>\n {fallbackNode}\n <div style={{ display: 'none' }}>{children}</div>\n </>\n ) : (\n children\n )}\n </LoadingBoundaryContext.Provider>\n );\n}\n\nexport function useLoadingBoundary(isLoading: boolean | undefined, label?: ReactNode): void {\n const store = useContext(LoadingBoundaryContext);\n\n useLayoutEffect(() => {\n if (!isLoading) {\n return;\n }\n\n const entry = { label };\n store.set((entries) => new Set(entries).add(entry));\n\n return () => {\n store.set((entries) => {\n const newEntries = new Set(entries);\n newEntries.delete(entry);\n return newEntries;\n });\n };\n }, [isLoading]);\n}\n","import type { Cache } from '@core';\nimport type { CacheState } from '@lib/cacheState';\nimport { makeSelector } from '@lib/makeSelector';\nimport { useLoadingBoundary } from '@react/loadingBoundary';\nimport { useEffect, useMemo, useRef } from 'react';\nimport { useStore, type UseStoreOptions } from './useStore';\n\nexport type UseCacheArray<T> = [\n value: T | undefined,\n error: unknown | undefined,\n isUpdating: boolean,\n isStale: boolean,\n];\n\nexport type UseCacheValue<T> = UseCacheArray<T> & CacheState<T>;\n\nexport interface UseCacheOptions<T> extends UseStoreOptions<UseCacheArray<T> & CacheState<T>> {\n /**\n * If true, will always return undefined as value and no fetch will be triggered.\n * @default false\n */\n disabled?: boolean;\n\n /**\n * If true, the cache will be invalidated when the component mounts.\n * @default false\n */\n updateOnMount?: boolean;\n\n /**\n * If true, `useCache` will throw a promise when the cache is pending. This can be used with React Suspense.\n * @see https://react.dev/reference/react/Suspense\n * @default false\n */\n suspense?: boolean;\n\n /**\n * If true, `useCache` will register its loading state with the nearest `LoadingBoundary`.\n * @default false\n */\n loadingBoundary?: boolean;\n}\n\nexport function useCache<T>(\n cache: Cache<T, any>,\n {\n passive,\n disabled,\n updateOnMount,\n withViewTransition,\n suspense,\n loadingBoundary,\n ...options\n }: UseCacheOptions<T> = {},\n): UseCacheValue<T> {\n if (withViewTransition === true) {\n withViewTransition = (state) => state.value;\n }\n\n const { rootCache, selector } = useMemo(() => {\n const rootCache: Cache<any, any> = cache.derivedFromCache?.cache ?? cache;\n let selector = (x: any) => x;\n\n if (cache.derivedFromCache) {\n selector = (value: any) => {\n for (const s of cache.derivedFromCache!.selectors) {\n value = makeSelector(s)(value);\n }\n return value;\n };\n }\n\n return { rootCache, selector };\n }, [cache]);\n\n const hasMounted = useRef(false);\n\n useEffect(() => {\n hasMounted.current = true;\n\n if (updateOnMount) {\n rootCache.invalidate();\n }\n }, []);\n\n const result = useStore(\n rootCache.state,\n (state) => {\n if (disabled) {\n return Object.assign<UseCacheArray<T>, CacheState<T>>(\n [undefined, undefined, false, false],\n { status: 'pending', isUpdating: false, isStale: false, isConnected: false },\n );\n }\n\n const isStale = updateOnMount && !hasMounted.current ? true : state.isStale;\n try {\n const value = state.status === 'value' ? selector(state.value) : undefined;\n\n return Object.assign<UseCacheArray<T>, CacheState<T>>(\n [value, state.error, state.isUpdating, isStale],\n { ...state, value, isStale },\n );\n } catch (error) {\n return Object.assign<UseCacheArray<T>, CacheState<T>>(\n [undefined, error, state.isUpdating, isStale],\n {\n status: 'error',\n error,\n isUpdating: state.isUpdating,\n isStale: isStale,\n isConnected: state.isConnected,\n },\n );\n }\n },\n { ...options, withViewTransition, passive: passive || disabled },\n );\n\n useEffect(\n () => rootCache.subscribe(() => undefined, { passive: passive || disabled }),\n [rootCache, passive || disabled],\n );\n\n useLoadingBoundary(loadingBoundary && !disabled && result.status === 'pending');\n\n if (suspense && result.status === 'pending') {\n throw rootCache.get();\n }\n\n return result;\n}\n","import type { Cache } from '@core';\nimport { type UseCacheOptions, type UseCacheValue, useCache } from '@react/useCache';\n\nexport const cacheMethods = {\n useCache<T>(this: Cache<T, any>, options?: UseCacheOptions<T>): UseCacheValue<T> {\n return useCache(this, options);\n },\n};\n","import { type Selector, type Update } from '@core/commonTypes';\nimport type { Store } from '@core/store';\nimport type { Constrain } from '@lib/constrain';\nimport { type Path, type Value } from '@lib/path';\nimport { useStore, type UseStoreOptions } from './useStore';\n\nexport function useProp<T, S>(\n store: Store<T>,\n selector: Selector<T, S>,\n updater: (value: S) => Update<T>,\n options?: UseStoreOptions<S>,\n): [value: S, setValue: Store<S>['set']];\n\nexport function useProp<T, const P>(\n store: Store<T>,\n selector: Constrain<P, Path<T>>,\n options?: UseStoreOptions<Value<T, P>>,\n): [value: Value<T, P>, setValue: Store<Value<T, P>>['set']];\n\nexport function useProp<T>(\n store: Store<T>,\n options?: UseStoreOptions<T>,\n): [value: T, setValue: Store<T>['set']];\n\nexport function useProp<T, S>(\n store: Store<T>,\n argument1?: any,\n argument2?: any,\n argument3?: any,\n): [value: S, setValue: Store<S>['set']] {\n const selector =\n typeof argument1 === 'function' || typeof argument1 === 'string' ? argument1 : undefined;\n const updater = typeof argument2 === 'function' ? argument2 : undefined;\n const options =\n typeof argument1 === 'object'\n ? argument1\n : typeof argument2 === 'object'\n ? argument2\n : argument3;\n\n if (selector) {\n store = store.map(selector, updater);\n }\n\n const value = useStore(store, options) as S;\n return [value, store.set as Store<S>['set']];\n}\n","import type { Scope, Selector, Update } from '@core';\nimport { createStore, type Store } from '@core/store';\nimport type { Constrain } from '@lib/constrain';\nimport type { Path, Value } from '@lib/path';\nimport { createContext, useContext, useMemo, type Context, type ReactNode } from 'react';\nimport { useProp } from './useProp';\nimport { useStore, type UseStoreOptions } from './useStore';\n\nexport type ScopeProps<T> = { scope: Scope<T>; store?: Store<T>; children?: ReactNode };\n\ndeclare module '@core' {\n interface Scope<T> {\n context?: Context<Store<T>>;\n }\n}\n\nfunction getScopeContext<T>(scope: Scope<T>): Context<Store<T>> {\n scope.context ??= createContext<Store<T>>(createStore(scope.defaultValue));\n return scope.context;\n}\n\nexport function ScopeProvider<T>({\n scope,\n store: inputStore,\n children,\n}: ScopeProps<T>): JSX.Element {\n const context = getScopeContext(scope);\n const currentStore = useMemo(\n () => inputStore ?? createStore(scope.defaultValue),\n [scope, inputStore],\n );\n\n return <context.Provider value={currentStore}>{children}</context.Provider>;\n}\n\nexport function useScope<T>(scope: Scope<T>): Store<T> {\n const context = getScopeContext(scope);\n return useContext(context);\n}\n\nexport function useScopeStore<T, S>(\n scope: Scope<T>,\n selector: Selector<T, S>,\n option?: UseStoreOptions<S>,\n): S;\n\nexport function useScopeStore<T, const P>(\n scope: Scope<T>,\n selector: Constrain<P, Path<T>>,\n option?: UseStoreOptions<Value<T, P>>,\n): Value<T, P>;\n\nexport function useScopeStore<T>(scope: Scope<T>, option?: UseStoreOptions<T>): T;\n\nexport function useScopeStore<T>(scope: Scope<T>, ...args: any[]): T {\n const store = useScope(scope);\n return useStore(store, ...args);\n}\n\nexport function useScopeProp<T, S>(\n scope: Scope<T>,\n selector: Selector<T, S>,\n updater: (value: S) => Update<T>,\n options?: UseStoreOptions<S>,\n): [value: S, setValue: Store<S>['set']];\n\nexport function useScopeProp<T, const P>(\n scope: Scope<T>,\n selector: Constrain<P, Path<T>>,\n options?: UseStoreOptions<Value<T, P>>,\n): [value: Value<T, P>, setValue: Store<Value<T, P>>['set']];\n\nexport function useScopeProp<T>(\n scope: Scope<T>,\n options?: UseStoreOptions<T>,\n): [value: T, setValue: Store<T>['set']];\n\nexport function useScopeProp<T>(\n scope: Scope<T>,\n ...args: any[]\n): [value: T, setValue: Store<T>['set']] {\n const store = useScope(scope);\n return useProp(store, ...args);\n}\n","import type { Scope, Selector, Store, Update } from '@core';\nimport type { Constrain } from '@lib/constrain';\nimport type { Path, Value } from '@lib/path';\nimport {\n ScopeProvider,\n useScope,\n useScopeProp,\n useScopeStore,\n type ScopeProps,\n} from '@react/scope';\nimport type { UseStoreOptions } from '@react/useStore';\n\nfunction boundUseScope<T>(this: Scope<T>): Store<T> {\n return useScope(this);\n}\n\nfunction boundUseScopeStore<T, S>(\n this: Scope<T>,\n selector: Selector<T, S>,\n option?: UseStoreOptions<S>,\n): S;\n\nfunction boundUseScopeStore<T, const P>(\n this: Scope<T>,\n selector: Constrain<P, Path<T>>,\n option?: UseStoreOptions<Value<T, P>>,\n): Value<T, P>;\n\nfunction boundUseScopeStore<T>(this: Scope<T>, option?: UseStoreOptions<T>): T;\n\nfunction boundUseScopeStore(this: Scope<any>, ...args: any[]) {\n return useScopeStore(this, ...args);\n}\n\nfunction boundUseScopeProp<T, S>(\n this: Scope<T>,\n selector: Selector<T, S>,\n updater: (value: S) => Update<T>,\n options?: UseStoreOptions<S>,\n): [value: S, setValue: Store<S>['set']];\n\nfunction boundUseScopeProp<T, const P>(\n this: Scope<T>,\n selector: Constrain<P, Path<T>>,\n options?: UseStoreOptions<Value<T, P>>,\n): [value: Value<T, P>, setValue: Store<Value<T, P>>['set']];\n\nfunction boundUseScopeProp<T>(\n this: Scope<T>,\n options?: UseStoreOptions<T>,\n): [value: T, setValue: Store<T>['set']];\n\nfunction boundUseScopeProp(this: Scope<any>, ...args: any[]) {\n return useScopeProp(this, ...args);\n}\n\nfunction Provider<T>(this: Scope<T>, props: Omit<ScopeProps<T>, 'scope'>): JSX.Element {\n return ScopeProvider({ ...props, scope: this });\n}\n\nexport const scopeMethods: {\n useScope: typeof boundUseScope;\n useStore: typeof boundUseScopeStore;\n useProp: typeof boundUseScopeProp;\n Provider: typeof Provider;\n} = {\n useScope: boundUseScope,\n useStore: boundUseScopeStore,\n useProp: boundUseScopeProp,\n Provider,\n};\n","import type { Selector, Store, Update } from '@core';\nimport type { Constrain } from '@lib/constrain';\nimport type { Path, Value } from '@lib/path';\nimport { useProp } from '@react/useProp';\nimport { type UseStoreOptions, useStore } from '@react/useStore';\n\nfunction boundUseStore<T, S>(\n this: Store<T>,\n selector: Selector<T, S>,\n option?: UseStoreOptions<S>,\n): S;\nfunction boundUseStore<T, const P>(\n this: Store<T>,\n selector: Constrain<P, Path<T>>,\n option?: UseStoreOptions<Value<T, P>>,\n): Value<T, P>;\nfunction boundUseStore<T>(this: Store<T>, option?: UseStoreOptions<T>): T;\nfunction boundUseStore(this: Store<any>, ...args: any[]) {\n return useStore(this, ...args);\n}\n\nfunction boundUseProp<T, S>(\n this: Store<T>,\n selector: Selector<T, S>,\n updater: (value: S) => Update<T>,\n options?: UseStoreOptions<S>,\n): [value: S, setValue: Store<S>['set']];\nfunction boundUseProp<T, const P>(\n this: Store<T>,\n selector: Constrain<P, Path<T>>,\n options?: UseStoreOptions<Value<T, P>>,\n): [value: Value<T, P>, setValue: Store<Value<T, P>>['set']];\nfunction boundUseProp<T>(\n this: Store<T>,\n options?: UseStoreOptions<T>,\n): [value: T, setValue: Store<T>['set']];\nfunction boundUseProp(this: Store<any>, ...args: any[]) {\n return useProp(this, ...args);\n}\n\nexport const storeMethods: {\n useStore: typeof boundUseStore;\n useProp: typeof boundUseProp;\n} = {\n useStore: boundUseStore,\n useProp: boundUseProp,\n};\n"],"names":["equals","shimModule","require$$0","require$$1","withSelectorModule","value","selector","useSyncExternalStoreWithSelector","rootCache"],"mappings":";;;;;;AAGA,MAAM,iBAAA,0BAA2C,aAAa,CAAA;AAK9C,SAAA,aAAA,CACd,KACA,EAAA,MAAA,GAAsC,SACpB,EAAA;AAClB,EAAI,IAAA,CAAC,cAAc,KAAK,CAAA,IAAK,CAAC,KAAM,CAAA,OAAA,CAAQ,KAAK,CAAG,EAAA;AAClD,IAAA,OAAO,CAAC,KAAO,EAAA,CAAC,UAAU,MAAO,CAAA,KAAA,EAAO,KAAK,CAAC,CAAA;AAAA;AAIhD,EAAS,KAAA,GAAA,KAAA,CAAc,iBAAiB,CAAK,IAAA,KAAA;AAE7C,EAAM,MAAA,IAAA,GAAO,IAAI,KAA6B,EAAA;AAC9C,EAAM,MAAA,WAAA,GAAc,IAAI,KAAkB,EAAA;AAC1C,EAAA,IAAI,OAAU,GAAA,KAAA;AAEd,EAAS,SAAA,gBAAA,CAAiB,cAAmB,IAAa,EAAA;AACxD,IAAM,MAAA,CAAC,YAAcA,EAAAA,OAAAA,EAAQ,MAAM,CAAA,GAAI,cAAc,SAAU,CAAA,KAAA,EAAO,GAAG,IAAI,CAAC,CAAA;AAE9E,IAAK,IAAA,CAAA,IAAA,CAAK,CAAC,UAAe,KAAA;AACxB,MAAI,IAAA,CAAC,cAAc,UAAU,CAAA,IAAK,CAAC,KAAM,CAAA,OAAA,CAAQ,UAAU,CAAG,EAAA;AAC5D,QAAO,OAAA,KAAA;AAAA;AAGT,MAAA,OAAOA,OAAO,CAAA,SAAA,CAAU,UAAY,EAAA,GAAG,IAAI,CAAC,CAAA;AAAA,KAC7C,CAAA;AAED,IAAA,IAAI,MAAQ,EAAA;AACV,MAAA,WAAA,CAAY,KAAK,MAAM,CAAA;AAAA;AAGzB,IAAO,OAAA,YAAA;AAAA;AAGT,EAAS,SAAA,eAAA,CAAgB,cAAmB,IAAa,EAAA;AACvD,IAAA,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AS,EAAA;AACX;;;;","x_google_ignoreList":[1,2,3,4,5,6]}
|
package/dist/es/urlStore.mjs
DELETED
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { d as debounce, b as createStore, e as disposable } from './store.mjs';
|
|
2
|
-
|
|
3
|
-
const urlStore = createStore(() => typeof window !== "undefined" ? window.location.href : "");
|
|
4
|
-
urlStore.addEffect(() => {
|
|
5
|
-
const originalPushState = window.history.pushState;
|
|
6
|
-
const originalReplaceState = window.history.replaceState;
|
|
7
|
-
const update = () => {
|
|
8
|
-
urlStore.set(window.location.href);
|
|
9
|
-
};
|
|
10
|
-
window.history.pushState = (...args) => {
|
|
11
|
-
originalPushState.apply(window.history, args);
|
|
12
|
-
update();
|
|
13
|
-
};
|
|
14
|
-
window.history.replaceState = (...args) => {
|
|
15
|
-
originalReplaceState.apply(window.history, args);
|
|
16
|
-
update();
|
|
17
|
-
};
|
|
18
|
-
window.addEventListener("popstate", update);
|
|
19
|
-
return () => {
|
|
20
|
-
window.history.pushState = originalPushState;
|
|
21
|
-
window.history.replaceState = originalReplaceState;
|
|
22
|
-
window.removeEventListener("popstate", update);
|
|
23
|
-
};
|
|
24
|
-
});
|
|
25
|
-
function updateUrlStore() {
|
|
26
|
-
urlStore.set(window.location.href);
|
|
27
|
-
}
|
|
28
|
-
function connectUrl(store, {
|
|
29
|
-
key,
|
|
30
|
-
type = "search",
|
|
31
|
-
serialize = defaultSerializer,
|
|
32
|
-
deserialize = defaultDeserializer,
|
|
33
|
-
defaultValue = undefined,
|
|
34
|
-
writeDefaultValue,
|
|
35
|
-
onCommit,
|
|
36
|
-
debounce: debounceTime = 500
|
|
37
|
-
}) {
|
|
38
|
-
const serializedDefaultValue = defaultValue !== undefined ? serialize(defaultValue) : undefined;
|
|
39
|
-
let isDirty = writeDefaultValue ?? false;
|
|
40
|
-
const commit = debounce(() => {
|
|
41
|
-
if (isDirty) {
|
|
42
|
-
const value = store.get();
|
|
43
|
-
const url = new URL(window.location.href);
|
|
44
|
-
const parameters = new URLSearchParams(url[type].slice(1));
|
|
45
|
-
const serializedValue = value !== undefined ? serialize(value) : undefined;
|
|
46
|
-
if (serializedValue === undefined || !writeDefaultValue && serializedValue === serializedDefaultValue) {
|
|
47
|
-
parameters.delete(key);
|
|
48
|
-
} else {
|
|
49
|
-
parameters.set(key, serializedValue);
|
|
50
|
-
}
|
|
51
|
-
url[type] = parameters.toString();
|
|
52
|
-
window.history.replaceState(window.history.state, "", url.toString());
|
|
53
|
-
window.dispatchEvent(new PopStateEvent("popstate"));
|
|
54
|
-
onCommit?.(value);
|
|
55
|
-
isDirty = false;
|
|
56
|
-
}
|
|
57
|
-
}, debounceTime);
|
|
58
|
-
const cancelUrlListener = urlStore.subscribe((_url) => {
|
|
59
|
-
if (isDirty) {
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
const url = new URL(_url);
|
|
63
|
-
const parameters = new URLSearchParams(url[type].slice(1));
|
|
64
|
-
const urlValue = parameters.get(key);
|
|
65
|
-
store.set(urlValue !== null ? deserialize(urlValue) : defaultValue);
|
|
66
|
-
});
|
|
67
|
-
const cancelSubscription = store.subscribe(
|
|
68
|
-
() => {
|
|
69
|
-
isDirty = true;
|
|
70
|
-
commit();
|
|
71
|
-
},
|
|
72
|
-
{ runNow: writeDefaultValue ?? false }
|
|
73
|
-
);
|
|
74
|
-
return disposable(() => {
|
|
75
|
-
cancelUrlListener();
|
|
76
|
-
cancelSubscription();
|
|
77
|
-
commit.flush();
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
function defaultDeserializer(value) {
|
|
81
|
-
if (value === undefined) {
|
|
82
|
-
return undefined;
|
|
83
|
-
}
|
|
84
|
-
try {
|
|
85
|
-
return JSON.parse(value, (_k, v) => {
|
|
86
|
-
if (typeof v === "object" && v !== null && "__set" in v) {
|
|
87
|
-
return new Set(v.__set);
|
|
88
|
-
}
|
|
89
|
-
if (typeof v === "object" && v !== null && "__map" in v) {
|
|
90
|
-
return new Map(v.__map);
|
|
91
|
-
}
|
|
92
|
-
return v;
|
|
93
|
-
});
|
|
94
|
-
} catch {
|
|
95
|
-
return undefined;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
function defaultSerializer(value) {
|
|
99
|
-
return JSON.stringify(value, (_k, v) => {
|
|
100
|
-
if (v instanceof Set) {
|
|
101
|
-
return { __set: Array.from(v) };
|
|
102
|
-
}
|
|
103
|
-
if (v instanceof Map) {
|
|
104
|
-
return { __map: Array.from(v) };
|
|
105
|
-
}
|
|
106
|
-
return v;
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function createUrlStore(options) {
|
|
110
|
-
const store = createStore(options.defaultValue, options);
|
|
111
|
-
connectUrl(store, options);
|
|
112
|
-
return store;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export { createUrlStore as a, connectUrl as c, updateUrlStore as u };
|
|
116
|
-
//# sourceMappingURL=urlStore.mjs.map
|
package/dist/es/urlStore.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"urlStore.mjs","sources":["../../src/core/urlStore.ts"],"sourcesContent":["import disposable from '@lib/disposable';\nimport { type DisposableCancel, type Duration } from './commonTypes';\nimport { createStore, type Store, type StoreOptions } from './store';\nimport { debounce } from '@lib/debounce';\n\nexport interface UrlStoreOptions<T> extends StoreOptions<T | undefined> {\n key: string;\n type?: 'search' | 'hash';\n serialize?: (value: T) => string;\n deserialize?: (value: string) => T;\n defaultValue?: T;\n writeDefaultValue?: boolean;\n onCommit?: (value: T | undefined) => void;\n debounce?: Duration;\n}\n\nexport interface UrlStoreOptionsWithDefaults<T> extends UrlStoreOptions<T> {\n defaultValue: T;\n}\n\nexport type UrlStoreOptionsRequired<T> = UrlStoreOptions<T> &\n Required<Pick<UrlStoreOptions<T>, 'type' | 'serialize' | 'deserialize' | 'defaultValue'>>;\n\nconst urlStore = createStore(() => (typeof window !== 'undefined' ? window.location.href : ''));\n\nurlStore.addEffect(() => {\n const originalPushState = window.history.pushState;\n const originalReplaceState = window.history.replaceState;\n\n const update = () => {\n urlStore.set(window.location.href);\n };\n\n window.history.pushState = (...args) => {\n originalPushState.apply(window.history, args);\n update();\n };\n\n window.history.replaceState = (...args) => {\n originalReplaceState.apply(window.history, args);\n update();\n };\n\n window.addEventListener('popstate', update);\n\n return () => {\n window.history.pushState = originalPushState;\n window.history.replaceState = originalReplaceState;\n window.removeEventListener('popstate', update);\n };\n});\n\nexport function updateUrlStore(): void {\n urlStore.set(window.location.href);\n}\n\nexport function connectUrl<T>(\n store: Store<T>,\n options: UrlStoreOptionsWithDefaults<T>,\n): DisposableCancel;\n\nexport function connectUrl<T>(\n store: Store<T | undefined>,\n options: UrlStoreOptions<T>,\n): DisposableCancel;\n\nexport function connectUrl<T>(\n store: Store<T>,\n {\n key,\n type = 'search',\n serialize = defaultSerializer,\n deserialize = defaultDeserializer,\n defaultValue = undefined as T,\n writeDefaultValue,\n onCommit,\n debounce: debounceTime = 500,\n }: UrlStoreOptions<T>,\n): DisposableCancel {\n const serializedDefaultValue = defaultValue !== undefined ? serialize(defaultValue) : undefined;\n let isDirty = writeDefaultValue ?? false;\n\n const commit = debounce(() => {\n if (isDirty) {\n const value = store.get();\n const url = new URL(window.location.href);\n const parameters = new URLSearchParams(url[type].slice(1));\n const serializedValue = value !== undefined ? serialize(value) : undefined;\n\n if (\n serializedValue === undefined ||\n (!writeDefaultValue && serializedValue === serializedDefaultValue)\n ) {\n parameters.delete(key);\n } else {\n parameters.set(key, serializedValue);\n }\n\n url[type] = parameters.toString();\n\n window.history.replaceState(window.history.state, '', url.toString());\n window.dispatchEvent(new PopStateEvent('popstate'));\n\n onCommit?.(value);\n isDirty = false;\n }\n }, debounceTime);\n\n const cancelUrlListener = urlStore.subscribe((_url) => {\n if (isDirty) {\n return;\n }\n\n const url = new URL(_url);\n const parameters = new URLSearchParams(url[type].slice(1));\n const urlValue = parameters.get(key);\n\n store.set(urlValue !== null ? deserialize(urlValue) : defaultValue);\n });\n\n const cancelSubscription = store.subscribe(\n () => {\n isDirty = true;\n commit();\n },\n { runNow: writeDefaultValue ?? false },\n );\n\n return disposable(() => {\n cancelUrlListener();\n cancelSubscription();\n commit.flush();\n });\n}\n\nfunction defaultDeserializer(value: string): any {\n if (value === undefined) {\n return undefined;\n }\n\n try {\n return JSON.parse(value, (_k, v) => {\n if (typeof v === 'object' && v !== null && '__set' in v) {\n return new Set(v.__set);\n }\n if (typeof v === 'object' && v !== null && '__map' in v) {\n return new Map(v.__map);\n }\n return v;\n });\n } catch {\n return undefined;\n }\n}\n\nfunction defaultSerializer(value: any): string {\n return JSON.stringify(value, (_k, v) => {\n if (v instanceof Set) {\n return { __set: Array.from(v) };\n }\n if (v instanceof Map) {\n return { __map: Array.from(v) };\n }\n return v;\n });\n}\n\nexport function createUrlStore<T>(options: UrlStoreOptionsWithDefaults<T>): Store<T>;\n\nexport function createUrlStore<T>(options: UrlStoreOptions<T>): Store<T | undefined>;\n\nexport function createUrlStore<T>(options: UrlStoreOptions<T>) {\n const store = createStore(options.defaultValue, options);\n connectUrl(store, options);\n return store;\n}\n"],"names":[],"mappings":";;AAuBA,MAAM,QAAA,GAAW,YAAY,MAAO,OAAO,WAAW,WAAc,GAAA,MAAA,CAAO,QAAS,CAAA,IAAA,GAAO,EAAG,CAAA;AAE9F,QAAA,CAAS,UAAU,MAAM;AACvB,EAAM,MAAA,iBAAA,GAAoB,OAAO,OAAQ,CAAA,SAAA;AACzC,EAAM,MAAA,oBAAA,GAAuB,OAAO,OAAQ,CAAA,YAAA;AAE5C,EAAA,MAAM,SAAS,MAAM;AACnB,IAAS,QAAA,CAAA,GAAA,CAAI,MAAO,CAAA,QAAA,CAAS,IAAI,CAAA;AAAA,GACnC;AAEA,EAAO,MAAA,CAAA,OAAA,CAAQ,SAAY,GAAA,CAAA,GAAI,IAAS,KAAA;AACtC,IAAkB,iBAAA,CAAA,KAAA,CAAM,MAAO,CAAA,OAAA,EAAS,IAAI,CAAA;AAC5C,IAAO,MAA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,CAAA;AAAA,GACR,CAAA;AACH;AAMO,SAAS,eAAkB,OAA6B,EAAA;AAC7D,EAAA,MAAM,KAAQ,GAAA,WAAA,CAAY,OAAQ,CAAA,YAAA,EAAc,OAAO,CAAA;AACvD,EAAA,UAAA,CAAW,OAAO,OAAO,CAAA;AACzB,EAAO,OAAA,KAAA;AACT;;;;"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import type { CacheState, ErrorState, ValueState } from '../lib/cacheState';
|
|
2
|
-
import type { Constrain } from '../lib/constrain';
|
|
3
|
-
import { type MaybePromise } from '../lib/maybePromise';
|
|
4
|
-
import type { AnyPath, Path, Value } from '../lib/path';
|
|
5
|
-
import type { Duration, Selector } from './commonTypes';
|
|
6
|
-
import { type ResourceGroup } from './resourceGroup';
|
|
7
|
-
import { Store, type Calculate, type StoreOptions } from './store';
|
|
8
|
-
export interface CacheGetOptions {
|
|
9
|
-
/**
|
|
10
|
-
* How to handle the cache when getting the value.
|
|
11
|
-
* - `whenMissing`: Only fetch a new value if there is no cached value.
|
|
12
|
-
* - `whenStale`: Fetch a new value if there is no cached value or if the cached value is stale.
|
|
13
|
-
* - `force`: Always fetch a new value, regardless of the cache state.
|
|
14
|
-
*/
|
|
15
|
-
update?: 'whenMissing' | 'whenStale' | 'force';
|
|
16
|
-
/**
|
|
17
|
-
* If set to `true`, the cache will be updated in the background.
|
|
18
|
-
* This means that a stale value will be returned immediately, if available, while the new value is being fetched.
|
|
19
|
-
*/
|
|
20
|
-
backgroundUpdate?: boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface CacheFunction<T, Args extends any[] = []> {
|
|
23
|
-
(...args: Args): Promise<T> | Calculate<Promise<T>>;
|
|
24
|
-
}
|
|
25
|
-
export interface CacheOptions<T, Args extends any[]> extends StoreOptions<Promise<T>> {
|
|
26
|
-
/**
|
|
27
|
-
* How long to keep the cache entry before it is considered stale.
|
|
28
|
-
* If set to `undefined` or `null`, the cache entry will never be invalidated automatically.
|
|
29
|
-
*
|
|
30
|
-
* @example
|
|
31
|
-
* ```typescript
|
|
32
|
-
* createCache(fetchData, {
|
|
33
|
-
* invalidateAfter: { seconds: 10 },
|
|
34
|
-
* });
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
invalidateAfter?: Duration | ((state: ValueState<T> | ErrorState) => Duration | null) | null;
|
|
38
|
-
/**
|
|
39
|
-
* If set, the cache will be invalidated when the window gets focused.
|
|
40
|
-
* This is useful for caches that are used in a browser environment and might become stale when the user switches tabs.
|
|
41
|
-
*/
|
|
42
|
-
invalidateOnWindowFocus?: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* If set, the cached value will be cleared when the cache is invalidated.
|
|
45
|
-
* Without this option, the cache will keep the last value as stale until a new value becomes available.
|
|
46
|
-
*/
|
|
47
|
-
clearOnInvalidate?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* If set, cache entries will be cleared after approximately the specified duration.
|
|
50
|
-
* This is useful for long lived pages or applications and helps to prevent memory leaks.
|
|
51
|
-
* The exact time when the entry is cleared is not guaranteed, since it will be cleared during garbage collection.
|
|
52
|
-
*/
|
|
53
|
-
clearUnusedAfter?: Duration | null;
|
|
54
|
-
/**
|
|
55
|
-
* Add the cache to the specified resource group(s).
|
|
56
|
-
* This allows you to invalidate or clear multiple caches that belong to the same group.
|
|
57
|
-
* All caches are always added to the `allResources` group.
|
|
58
|
-
*/
|
|
59
|
-
resourceGroup?: ResourceGroup | ResourceGroup[];
|
|
60
|
-
/**
|
|
61
|
-
* Function to generate a custom cache key based on the provided arguments.
|
|
62
|
-
* This allows you to control how cache entries are identified and reused.
|
|
63
|
-
* By default, the arguments array is used as the cache key.
|
|
64
|
-
*
|
|
65
|
-
* @example
|
|
66
|
-
* ```typescript
|
|
67
|
-
* // Will use the same instance when provided with `undefined`, `{ num: 0 }`, `{ bool: false }`, etc.
|
|
68
|
-
* createCache((filter?: { num?: number, bool?: boolean }) => fetchData(filter), {
|
|
69
|
-
* getCacheKey: (filter?) => ({
|
|
70
|
-
* num: filter?.num ?? 0,
|
|
71
|
-
* bool: filter?.bool ?? false,
|
|
72
|
-
* }),
|
|
73
|
-
* });
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
getCacheKey?: (...args: NoInfer<Args>) => unknown;
|
|
77
|
-
}
|
|
78
|
-
export declare class Cache<T, Args extends any[] = unknown[]> extends Store<Promise<T>> {
|
|
79
|
-
readonly args: Args;
|
|
80
|
-
readonly options: CacheOptions<T, Args>;
|
|
81
|
-
readonly derivedFromCache?: {
|
|
82
|
-
cache: Cache<any, any>;
|
|
83
|
-
selectors: (Selector<any, any> | AnyPath)[];
|
|
84
|
-
} | undefined;
|
|
85
|
-
readonly state: Store<CacheState<T>>;
|
|
86
|
-
protected stalePromise?: Promise<T>;
|
|
87
|
-
protected invalidationTimer?: ReturnType<typeof setTimeout>;
|
|
88
|
-
constructor(getter: Calculate<Promise<T>>, args: Args, options?: CacheOptions<T, Args>, derivedFromCache?: {
|
|
89
|
-
cache: Cache<any, any>;
|
|
90
|
-
selectors: (Selector<any, any> | AnyPath)[];
|
|
91
|
-
} | undefined);
|
|
92
|
-
get({ update, backgroundUpdate }?: CacheGetOptions): Promise<T>;
|
|
93
|
-
updateValue(value: MaybePromise<T> | ((value: T | undefined) => T)): void;
|
|
94
|
-
updateError(error: unknown): void;
|
|
95
|
-
invalidate(recursive?: boolean): void;
|
|
96
|
-
clear(recursive?: boolean): void;
|
|
97
|
-
mapValue<S>(selector: Selector<T, S>): Cache<S, Args>;
|
|
98
|
-
mapValue<const P extends AnyPath>(selector: P extends Path<T> ? P : Path<T>): Cache<Value<T, P>, Args>;
|
|
99
|
-
protected watchPromise(): void;
|
|
100
|
-
protected setTimers(): void;
|
|
101
|
-
protected watchFocus(): void;
|
|
102
|
-
}
|
|
103
|
-
export type CreateCacheResult<T, Args extends any[]> = [] extends Args ? CacheBundle<T, Args> & Cache<T, Args> : CacheBundle<T, Args>;
|
|
104
|
-
export interface InvalidationOptions<T, Args extends any[]> {
|
|
105
|
-
filter?: (cache: Cache<T, Args>) => boolean;
|
|
106
|
-
}
|
|
107
|
-
export type CacheBundle<T, Args extends any[]> = {
|
|
108
|
-
(...args: Args): Cache<T, Args>;
|
|
109
|
-
mapCache<S>(selector: Selector<T, S>): CreateCacheResult<S, Args>;
|
|
110
|
-
mapValue<const P>(selector: Constrain<P, Path<T>>): CreateCacheResult<Value<T, P>, Args>;
|
|
111
|
-
invalidateAll: (options?: InvalidationOptions<T, Args>) => void;
|
|
112
|
-
clearAll: (options?: InvalidationOptions<T, Args>) => void;
|
|
113
|
-
getInstances: () => Cache<T, Args>[];
|
|
114
|
-
};
|
|
115
|
-
declare function create<T, Args extends any[] = []>(cacheFunction: CacheFunction<T, Args>, options?: CacheOptions<T, Args>): CreateCacheResult<T, Args>;
|
|
116
|
-
export declare const createCache: typeof create & {
|
|
117
|
-
defaultOptions: CacheOptions<any, any>;
|
|
118
|
-
};
|
|
119
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import type { DebounceOptions } from '../lib/debounce';
|
|
2
|
-
import { type MaybePromise } from '../lib/maybePromise';
|
|
3
|
-
import type { Store } from './store';
|
|
4
|
-
export interface Listener<T = void, TThis = unknown> {
|
|
5
|
-
(this: TThis, value: T, previouseValue?: T): void;
|
|
6
|
-
}
|
|
7
|
-
export interface Selector<T, S> {
|
|
8
|
-
(value: T): S;
|
|
9
|
-
}
|
|
10
|
-
export interface Effect<T> {
|
|
11
|
-
(this: T, context: T): void | Cancel;
|
|
12
|
-
}
|
|
13
|
-
export interface SubscribeOptions {
|
|
14
|
-
/** If set, this listener does not activate the store.
|
|
15
|
-
* @default false
|
|
16
|
-
*/
|
|
17
|
-
passive?: boolean;
|
|
18
|
-
/** Whether to execute the callback immediately with the current store value.
|
|
19
|
-
* @default true
|
|
20
|
-
*/
|
|
21
|
-
runNow?: boolean;
|
|
22
|
-
/** If set, throttle how often the callback can be executed.
|
|
23
|
-
* The values says how much time needs to pass between to calls.
|
|
24
|
-
* @example
|
|
25
|
-
* subscribe(callback, { throttle: { seconds: 10 } }); // Will execute immediately and then at least 10 seconds havbe to pass. If the store changed during those 10 seconds, the callback will be executed again.
|
|
26
|
-
*/
|
|
27
|
-
throttle?: Duration;
|
|
28
|
-
/** If set, callback execution is delayed. */
|
|
29
|
-
debounce?: DebounceOptions;
|
|
30
|
-
/** Provide a custom equality function. By default a strict equals (===) will be used.
|
|
31
|
-
*/
|
|
32
|
-
equals?: (a: any, b: any) => boolean;
|
|
33
|
-
}
|
|
34
|
-
export interface Cancel {
|
|
35
|
-
(): void;
|
|
36
|
-
}
|
|
37
|
-
export interface DisposableCancel {
|
|
38
|
-
(): void;
|
|
39
|
-
[Symbol.dispose](): void;
|
|
40
|
-
}
|
|
41
|
-
export type Duration = number | {
|
|
42
|
-
milliseconds?: number;
|
|
43
|
-
seconds?: number;
|
|
44
|
-
minutes?: number;
|
|
45
|
-
hours?: number;
|
|
46
|
-
days?: number;
|
|
47
|
-
};
|
|
48
|
-
export type UpdateFrom<Value, From extends any[]> = Value | ((...args: From) => Value);
|
|
49
|
-
export type Update<Value> = UpdateFrom<Value, [Value]>;
|
|
50
|
-
export interface UpdateFunction<Value> {
|
|
51
|
-
(update: Update<Value>): void;
|
|
52
|
-
}
|
|
53
|
-
export interface AsyncUpdateFunction<Value> {
|
|
54
|
-
(update: UpdateFrom<MaybePromise<Value>, [Value]>): void;
|
|
55
|
-
}
|
|
56
|
-
export interface Use {
|
|
57
|
-
<T>(store: Store<T>): T;
|
|
58
|
-
}
|
|
59
|
-
export interface BaseConnectionActions<T> {
|
|
60
|
-
set: UpdateFunction<T>;
|
|
61
|
-
}
|
|
62
|
-
export interface AsyncConnectionActions<T> extends BaseConnectionActions<T> {
|
|
63
|
-
updateValue: AsyncUpdateFunction<T>;
|
|
64
|
-
updateError: (error: unknown) => void;
|
|
65
|
-
updateIsConnected: (isConnected: boolean) => void;
|
|
66
|
-
close: () => void;
|
|
67
|
-
}
|
|
68
|
-
export type ConnectionActions<T> = BaseConnectionActions<T> & (T extends Promise<infer S> ? AsyncConnectionActions<S> : {});
|
|
69
|
-
export interface Connection<T> {
|
|
70
|
-
(actions: ConnectionActions<T>): Cancel;
|
|
71
|
-
}
|
|
72
|
-
export interface CalculationActions<T> {
|
|
73
|
-
signal: AbortSignal;
|
|
74
|
-
use: Use;
|
|
75
|
-
connect(connection: Connection<T>): Promise<void>;
|
|
76
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { Cache, createCache, type CacheBundle, type CacheFunction, type CacheGetOptions, type CacheOptions, type CreateCacheResult, } from './cache';
|
|
2
|
-
export type { AsyncConnectionActions, AsyncUpdateFunction, BaseConnectionActions, CalculationActions, Cancel, Connection, ConnectionActions, DisposableCancel, Duration, Effect, Listener, Selector, SubscribeOptions, Update, UpdateFrom, UpdateFunction, Use, } from './commonTypes';
|
|
3
|
-
export { allResources, createResourceGroup, ResourceGroup, type Resource } from './resourceGroup';
|
|
4
|
-
export { createScope, Scope } from './scope';
|
|
5
|
-
export { createStore, Store, type BoundStoreMethods, type StoreMethods, type StoreOptions, type StoreOptionsWithMethods, } from './store';
|
|
6
|
-
export { connectUrl, createUrlStore, updateUrlStore, type UrlStoreOptions } from './urlStore';
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
export interface Resource {
|
|
2
|
-
invalidateAll(): void;
|
|
3
|
-
clearAll(): void;
|
|
4
|
-
}
|
|
5
|
-
export declare class ResourceGroup {
|
|
6
|
-
readonly name?: string | undefined;
|
|
7
|
-
private refMap;
|
|
8
|
-
private refSet;
|
|
9
|
-
constructor(name?: string | undefined);
|
|
10
|
-
add(resource: Resource): void;
|
|
11
|
-
delete(resource: Resource): void;
|
|
12
|
-
invalidateAll(): void;
|
|
13
|
-
clearAll(): void;
|
|
14
|
-
}
|
|
15
|
-
export declare const allResources: ResourceGroup;
|
|
16
|
-
export declare function createResourceGroup(name?: string): ResourceGroup;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { type CalculatedValue } from '../lib/calculatedValue';
|
|
2
|
-
import type { Constrain } from '../lib/constrain';
|
|
3
|
-
import type { AnyPath, Path, SettablePath, Value } from '../lib/path';
|
|
4
|
-
import { PromiseWithCancel } from '../lib/promiseWithCancel';
|
|
5
|
-
import { arrayMethods, mapMethods, recordMethods, setMethods } from '../lib/standardMethods';
|
|
6
|
-
import type { CalculationActions, Cancel, DisposableCancel, Duration, Effect, Listener, Selector, SubscribeOptions, Update } from './commonTypes';
|
|
7
|
-
export type StoreMethods = Record<string, (...args: any[]) => any>;
|
|
8
|
-
export type BoundStoreMethods<T, Methods extends StoreMethods> = Methods & ThisType<Store<T> & Methods>;
|
|
9
|
-
export interface StoreOptions<T> {
|
|
10
|
-
retain?: Duration;
|
|
11
|
-
equals?: SubscribeOptions['equals'];
|
|
12
|
-
effect?: Effect<Store<T>> | {
|
|
13
|
-
effect: Effect<Store<T>>;
|
|
14
|
-
retain?: Duration;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
export interface StoreOptionsWithMethods<T, Methods extends StoreMethods> extends StoreOptions<T> {
|
|
18
|
-
methods?: Methods & ThisType<Store<T> & Methods & StandardMethods<T>>;
|
|
19
|
-
}
|
|
20
|
-
export type Calculate<T> = (helpers: CalculationActions<T>) => T;
|
|
21
|
-
type StandardMethods<T> = T extends Map<any, any> ? typeof mapMethods : T extends Set<any> ? typeof setMethods : T extends Array<any> ? typeof arrayMethods : T extends Record<any, any> ? typeof recordMethods : Record<string, never>;
|
|
22
|
-
type StoreWithMethods<T, Methods extends StoreMethods> = Store<T> & Omit<BoundStoreMethods<T, Methods>, keyof Store<T>> & StandardMethods<T>;
|
|
23
|
-
export interface OnceOptions {
|
|
24
|
-
signal?: AbortSignal;
|
|
25
|
-
timeout?: Duration;
|
|
26
|
-
}
|
|
27
|
-
export declare class Store<T> {
|
|
28
|
-
readonly getter: T | Calculate<T>;
|
|
29
|
-
readonly options: StoreOptions<T>;
|
|
30
|
-
readonly derivedFrom?: {
|
|
31
|
-
store: Store<any>;
|
|
32
|
-
selectors: (Selector<any, any> | AnyPath)[];
|
|
33
|
-
updater: (state: any) => void;
|
|
34
|
-
} | undefined;
|
|
35
|
-
private static hooks?;
|
|
36
|
-
static addHook(hook: (store: Store<any>) => void): DisposableCancel;
|
|
37
|
-
version?: string;
|
|
38
|
-
protected calculatedValue?: CalculatedValue<T>;
|
|
39
|
-
protected defaultValue?: CalculatedValue<T>;
|
|
40
|
-
protected listeners: Map<Listener, boolean>;
|
|
41
|
-
protected effects: Map<Effect<Store<T>>, {
|
|
42
|
-
handle?: Cancel;
|
|
43
|
-
retain?: number;
|
|
44
|
-
timeout?: ReturnType<typeof setTimeout>;
|
|
45
|
-
}>;
|
|
46
|
-
protected notifyId: {};
|
|
47
|
-
constructor(getter: T | Calculate<T>, options?: StoreOptions<T>, derivedFrom?: {
|
|
48
|
-
store: Store<any>;
|
|
49
|
-
selectors: (Selector<any, any> | AnyPath)[];
|
|
50
|
-
updater: (state: any) => void;
|
|
51
|
-
} | undefined);
|
|
52
|
-
get(): T;
|
|
53
|
-
set(update: Update<T>): void;
|
|
54
|
-
set<const P>(path: Constrain<P, Path<T>>, update: Update<Value<T, P>>): void;
|
|
55
|
-
invalidate(recursive?: boolean): void;
|
|
56
|
-
subscribe(listener: Listener<T, {
|
|
57
|
-
cancel: Cancel;
|
|
58
|
-
}>, options?: SubscribeOptions): DisposableCancel;
|
|
59
|
-
once<S extends T>(condition: (value: T) => value is S, options?: OnceOptions): PromiseWithCancel<S>;
|
|
60
|
-
once(condition: (value: T) => boolean, options?: OnceOptions): PromiseWithCancel<T>;
|
|
61
|
-
once(options?: OnceOptions): PromiseWithCancel<T>;
|
|
62
|
-
map<S>(selector: Selector<T, S>, updater?: (value: S) => Update<T>): Store<S>;
|
|
63
|
-
map<const P>(selector: Constrain<P, SettablePath<T>>): Store<Value<T, P>>;
|
|
64
|
-
/** Add an effect that will be executed when the store becomes active, which means when it has at least one subscriber.
|
|
65
|
-
* @param effect
|
|
66
|
-
* If there is already a subscriber, the effect will be executed immediately.
|
|
67
|
-
* Otherweise it will be executed as soon as the first subscription is created.
|
|
68
|
-
* Every time all subscriptions are removed and the first is created again, the effect will be executed again.
|
|
69
|
-
* @param retain
|
|
70
|
-
* If provided, delay tearing down effects when the last subscriber is removed. This is useful if a short gap in subscriber coverage is supposed to be ignored. E.g. when switching pages, the old page might unsubscribe, while the new page subscribes immediately after.
|
|
71
|
-
* @returns
|
|
72
|
-
* The effect can return a teardown callback, which will be executed when the last subscription is removed and potentially the ratain time has passed.
|
|
73
|
-
*/
|
|
74
|
-
addEffect(effect: Effect<Store<T>>, retain?: Duration | undefined): DisposableCancel;
|
|
75
|
-
/** Return whether the store is currently active, which means whether it has at least one subscriber. */
|
|
76
|
-
isActive(): boolean;
|
|
77
|
-
protected onSubscribe(): void;
|
|
78
|
-
protected onUnsubscribe(): void;
|
|
79
|
-
protected notify(): void;
|
|
80
|
-
}
|
|
81
|
-
declare function create<T>(calculate: Calculate<T>, options?: StoreOptions<T>): Store<T>;
|
|
82
|
-
declare function create<T, Methods extends StoreMethods = {}>(initialState: T, options?: StoreOptionsWithMethods<T, Methods>): StoreWithMethods<T, Methods>;
|
|
83
|
-
export declare const createStore: typeof create & {
|
|
84
|
-
defaultOptions: StoreOptions<any>;
|
|
85
|
-
};
|
|
86
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type DisposableCancel, type Duration } from './commonTypes';
|
|
2
|
-
import { type Store, type StoreOptions } from './store';
|
|
3
|
-
export interface UrlStoreOptions<T> extends StoreOptions<T | undefined> {
|
|
4
|
-
key: string;
|
|
5
|
-
type?: 'search' | 'hash';
|
|
6
|
-
serialize?: (value: T) => string;
|
|
7
|
-
deserialize?: (value: string) => T;
|
|
8
|
-
defaultValue?: T;
|
|
9
|
-
writeDefaultValue?: boolean;
|
|
10
|
-
onCommit?: (value: T | undefined) => void;
|
|
11
|
-
debounce?: Duration;
|
|
12
|
-
}
|
|
13
|
-
export interface UrlStoreOptionsWithDefaults<T> extends UrlStoreOptions<T> {
|
|
14
|
-
defaultValue: T;
|
|
15
|
-
}
|
|
16
|
-
export type UrlStoreOptionsRequired<T> = UrlStoreOptions<T> & Required<Pick<UrlStoreOptions<T>, 'type' | 'serialize' | 'deserialize' | 'defaultValue'>>;
|
|
17
|
-
export declare function updateUrlStore(): void;
|
|
18
|
-
export declare function connectUrl<T>(store: Store<T>, options: UrlStoreOptionsWithDefaults<T>): DisposableCancel;
|
|
19
|
-
export declare function connectUrl<T>(store: Store<T | undefined>, options: UrlStoreOptions<T>): DisposableCancel;
|
|
20
|
-
export declare function createUrlStore<T>(options: UrlStoreOptionsWithDefaults<T>): Store<T>;
|
|
21
|
-
export declare function createUrlStore<T>(options: UrlStoreOptions<T>): Store<T | undefined>;
|
package/dist/types/index.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from './core';
|
|
2
|
-
export { applyPatches } from './lib/applyPatches';
|
|
3
|
-
export * from './lib/cacheState';
|
|
4
|
-
export { calcDuration } from './lib/calcDuration';
|
|
5
|
-
export { diff, type Patch } from './lib/diff';
|
|
6
|
-
export { deepEqual, shallowEqual, strictEqual } from './lib/equals';
|
|
7
|
-
export { fromExtendedJson, fromExtendedJsonString, toExtendedJson, toExtendedJsonString, } from './lib/extendedJson';
|
|
8
|
-
export { hash, simpleHash, type Hashable } from './lib/hash';
|
|
9
|
-
export { InstanceCache } from './lib/instanceCache';
|
|
10
|
-
export { type Path, type PathAsArray, type PathAsString, type SettablePath, type SettablePathAsArray, type SettablePathAsString, type Value, } from './lib/path';
|
|
11
|
-
export { get, set } from './lib/propAccess';
|
|
12
|
-
export { arrayMethods, mapMethods, recordMethods, setMethods } from './lib/standardMethods';
|
|
13
|
-
export * from './lib/updateHelpers';
|
|
14
|
-
export * from './persist';
|