@storesjs/stores 0.10.0 → 0.12.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/index.d.ts +1583 -4
- package/dist/native/index.js +7 -1
- package/dist/native/index.mjs +7 -1
- package/dist/plugins/chrome/index.d.ts +186 -4
- package/dist/vanilla/index.js +1 -1
- package/dist/vanilla/index.mjs +1 -1
- package/dist/vanilla/index.vanilla.d.ts +1469 -1
- package/dist/web/chrome.js +1 -1
- package/dist/web/chrome.mjs +1 -1
- package/dist/web/index.js +1 -1
- package/dist/web/index.mjs +1 -1
- package/dist/web/internal/runtime.js +2 -1
- package/dist/web/internal/runtime.mjs +2 -1
- package/dist/web/queryParam-Ckp7Zi5t.mjs +1 -0
- package/dist/web/queryParam-Ctnhipnd.js +1 -0
- package/dist/web/serialization-BgaGfw_1.mjs +1 -0
- package/dist/web/serialization-Dau9pNHc.js +1 -0
- package/dist/web/utils-Ba1RIeAA.mjs +1 -0
- package/dist/web/utils-CwejruRb.js +1 -0
- package/package.json +7 -7
- package/dist/createBaseStore.d.ts +0 -36
- package/dist/createDerivedStore.d.ts +0 -63
- package/dist/createQueryStore.d.ts +0 -117
- package/dist/createVirtualStore.d.ts +0 -40
- package/dist/env.native.d.ts +0 -7
- package/dist/env.web.d.ts +0 -7
- package/dist/hooks/useLazyRef.d.ts +0 -13
- package/dist/hooks/useListen.d.ts +0 -98
- package/dist/hooks/useStableValue.d.ts +0 -16
- package/dist/hooks/useSyncExternalStoreWithSelector.d.ts +0 -5
- package/dist/index.shared.d.ts +0 -14
- package/dist/index.vanilla.d.ts +0 -2
- package/dist/internal/baseStore.d.ts +0 -2
- package/dist/internal/config.d.ts +0 -64
- package/dist/internal/createStoreActions.d.ts +0 -24
- package/dist/internal/derivedStore/cascadeScheduler.d.ts +0 -31
- package/dist/internal/derivedStore/deriveProxy.d.ts +0 -15
- package/dist/internal/derivedStore/pathFinder.d.ts +0 -26
- package/dist/internal/derivedStore.d.ts +0 -2
- package/dist/internal/errors.d.ts +0 -10
- package/dist/internal/logger.d.ts +0 -10
- package/dist/internal/middleware/createHydrationGate.d.ts +0 -20
- package/dist/internal/queryStore/queryStoreDefaults.d.ts +0 -8
- package/dist/internal/queryStore.d.ts +0 -2
- package/dist/internal/runtime.d.ts +0 -13
- package/dist/internal/signal.d.ts +0 -12
- package/dist/internal/storage/storageCreators.d.ts +0 -12
- package/dist/internal/storeUtils.d.ts +0 -46
- package/dist/internal/sync/browserSyncEngine.d.ts +0 -3
- package/dist/internal/sync/noopSyncEngine.d.ts +0 -3
- package/dist/internal/sync/syncEnhancer.d.ts +0 -26
- package/dist/internal/sync/syncUtils.d.ts +0 -6
- package/dist/internal/utils/persistUtils.d.ts +0 -9
- package/dist/internal/virtualStore.d.ts +0 -2
- package/dist/plugins/chrome/chromeExtensionSyncEngine.d.ts +0 -30
- package/dist/plugins/chrome/chromeStorageAdapter.d.ts +0 -31
- package/dist/plugins/chrome/createSyncedChromeStorage.d.ts +0 -14
- package/dist/queryStore/classes/SubscriptionManager.d.ts +0 -67
- package/dist/queryStore/queryKey.d.ts +0 -3
- package/dist/queryStore/signalTypes.d.ts +0 -14
- package/dist/queryStore/types.d.ts +0 -403
- package/dist/storage/storageTypes.d.ts +0 -13
- package/dist/store/attachStoreHook.react.d.ts +0 -5
- package/dist/store/attachStoreHook.vanilla.d.ts +0 -6
- package/dist/store/batchStoreNotifications.native.d.ts +0 -3
- package/dist/store/batchStoreNotifications.web.d.ts +0 -2
- package/dist/store/createStore.d.ts +0 -6
- package/dist/store/persist.d.ts +0 -14
- package/dist/store/stateUpdate.d.ts +0 -10
- package/dist/store/types.d.ts +0 -108
- package/dist/storesStorage.native.d.ts +0 -3
- package/dist/storesStorage.web.d.ts +0 -3
- package/dist/sync/types.d.ts +0 -115
- package/dist/types/functions.d.ts +0 -24
- package/dist/types/objects.d.ts +0 -11
- package/dist/types/setState.d.ts +0 -22
- package/dist/types/subscribe.d.ts +0 -28
- package/dist/types/useStoreCallSignatures.d.ts +0 -2
- package/dist/types/useStoreCallSignatures.react.d.ts +0 -6
- package/dist/types/useStoreCallSignatures.vanilla.d.ts +0 -2
- package/dist/types/utils.d.ts +0 -13
- package/dist/types.d.ts +0 -286
- package/dist/utils/core.d.ts +0 -26
- package/dist/utils/createAsyncMicrotaskScheduler.d.ts +0 -35
- package/dist/utils/createMicrotaskScheduler.d.ts +0 -28
- package/dist/utils/debounce.d.ts +0 -22
- package/dist/utils/equality.d.ts +0 -38
- package/dist/utils/hydrationCoordinator.d.ts +0 -13
- package/dist/utils/promiseUtils.d.ts +0 -2
- package/dist/utils/serialization.d.ts +0 -14
- package/dist/utils/stringUtils.d.ts +0 -7
- package/dist/utils/time.d.ts +0 -37
- package/dist/vanilla/createBaseStore.d.ts +0 -35
- package/dist/vanilla/createDerivedStore.d.ts +0 -62
- package/dist/vanilla/createQueryStore.d.ts +0 -116
- package/dist/vanilla/createVirtualStore.d.ts +0 -39
- package/dist/vanilla/env.web.d.ts +0 -6
- package/dist/vanilla/index.d.ts +0 -1
- package/dist/vanilla/index.shared.d.ts +0 -13
- package/dist/vanilla/internal/baseStore.d.ts +0 -1
- package/dist/vanilla/internal/config.d.ts +0 -63
- package/dist/vanilla/internal/createStoreActions.d.ts +0 -23
- package/dist/vanilla/internal/derivedStore/cascadeScheduler.d.ts +0 -30
- package/dist/vanilla/internal/derivedStore/deriveProxy.d.ts +0 -14
- package/dist/vanilla/internal/derivedStore/pathFinder.d.ts +0 -25
- package/dist/vanilla/internal/derivedStore.d.ts +0 -1
- package/dist/vanilla/internal/errors.d.ts +0 -9
- package/dist/vanilla/internal/logger.d.ts +0 -9
- package/dist/vanilla/internal/middleware/createHydrationGate.d.ts +0 -19
- package/dist/vanilla/internal/queryStore/queryStoreDefaults.d.ts +0 -7
- package/dist/vanilla/internal/queryStore.d.ts +0 -1
- package/dist/vanilla/internal/runtime.d.ts +0 -12
- package/dist/vanilla/internal/signal.d.ts +0 -11
- package/dist/vanilla/internal/storage/storageCreators.d.ts +0 -11
- package/dist/vanilla/internal/storeUtils.d.ts +0 -45
- package/dist/vanilla/internal/sync/browserSyncEngine.d.ts +0 -2
- package/dist/vanilla/internal/sync/noopSyncEngine.d.ts +0 -2
- package/dist/vanilla/internal/sync/syncEnhancer.d.ts +0 -25
- package/dist/vanilla/internal/utils/persistUtils.d.ts +0 -8
- package/dist/vanilla/internal/virtualStore.d.ts +0 -1
- package/dist/vanilla/queryStore/classes/SubscriptionManager.d.ts +0 -66
- package/dist/vanilla/queryStore/queryKey.d.ts +0 -2
- package/dist/vanilla/queryStore/signalTypes.d.ts +0 -13
- package/dist/vanilla/queryStore/types.d.ts +0 -402
- package/dist/vanilla/storage/storageTypes.d.ts +0 -12
- package/dist/vanilla/store/attachStoreHook.d.ts +0 -5
- package/dist/vanilla/store/attachStoreHook.vanilla.d.ts +0 -5
- package/dist/vanilla/store/batchStoreNotifications.web.d.ts +0 -1
- package/dist/vanilla/store/createStore.d.ts +0 -5
- package/dist/vanilla/store/persist.d.ts +0 -13
- package/dist/vanilla/store/stateUpdate.d.ts +0 -9
- package/dist/vanilla/store/types.d.ts +0 -107
- package/dist/vanilla/storesStorage.web.d.ts +0 -2
- package/dist/vanilla/sync/types.d.ts +0 -114
- package/dist/vanilla/types/functions.d.ts +0 -23
- package/dist/vanilla/types/objects.d.ts +0 -10
- package/dist/vanilla/types/setState.d.ts +0 -21
- package/dist/vanilla/types/subscribe.d.ts +0 -27
- package/dist/vanilla/types/useStoreCallSignatures.d.ts +0 -1
- package/dist/vanilla/types/useStoreCallSignatures.vanilla.d.ts +0 -1
- package/dist/vanilla/types/utils.d.ts +0 -12
- package/dist/vanilla/types.d.ts +0 -285
- package/dist/vanilla/utils/core.d.ts +0 -25
- package/dist/vanilla/utils/createAsyncMicrotaskScheduler.d.ts +0 -34
- package/dist/vanilla/utils/createMicrotaskScheduler.d.ts +0 -27
- package/dist/vanilla/utils/debounce.d.ts +0 -21
- package/dist/vanilla/utils/equality.d.ts +0 -37
- package/dist/vanilla/utils/hydrationCoordinator.d.ts +0 -12
- package/dist/vanilla/utils/promiseUtils.d.ts +0 -1
- package/dist/vanilla/utils/serialization.d.ts +0 -13
- package/dist/vanilla/utils/stringUtils.d.ts +0 -6
- package/dist/vanilla/utils/time.d.ts +0 -36
- package/dist/web/chunk-QJLWBD7M.mjs +0 -1
- package/dist/web/chunk-V4LHP7LR.mjs +0 -1
|
@@ -1,4 +1,186 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
//#region src/types/functions.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Unknown generic function type.
|
|
4
|
+
*/
|
|
5
|
+
type UnknownFunction = (...args: never[]) => unknown;
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/sync/types.d.ts
|
|
8
|
+
type SyncStateKey<T extends Record<string, unknown>> = Extract<{ [K in keyof T]-?: T[K] extends UnknownFunction ? never : K }[keyof T], string>;
|
|
9
|
+
type SyncValues<T extends Record<string, unknown>> = Partial<T> & { [K in SyncStateKey<T>]?: T[K] };
|
|
10
|
+
type SyncUpdate<T extends Record<string, unknown>> = {
|
|
11
|
+
replace: boolean;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
timestamp: number;
|
|
14
|
+
values: SyncValues<T>;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Passed to `SyncEngine.register()` to connect a store to the sync system.
|
|
18
|
+
*/
|
|
19
|
+
type SyncRegistration<T extends Record<string, unknown>> = {
|
|
20
|
+
/** Callback invoked by the engine to apply incoming remote updates to the store. */apply: (update: SyncUpdate<T>) => void; /** The state keys to sync. Non-function properties only. */
|
|
21
|
+
fields: ReadonlyArray<SyncStateKey<T>>; /** Returns the store's current state. Used by engines that need to read state (e.g., for diffing). */
|
|
22
|
+
getState: () => T; /** Unique identifier for this store. Must match across clients to sync the same data. */
|
|
23
|
+
key: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Returned by `SyncEngine.register()`. Controls the lifecycle of a synced store.
|
|
27
|
+
*/
|
|
28
|
+
interface SyncHandle<T extends Record<string, unknown>> {
|
|
29
|
+
/**
|
|
30
|
+
* Permanently removes this store from the sync engine. After calling, the handle
|
|
31
|
+
* is invalid and the store will no longer send or receive updates. To temporarily
|
|
32
|
+
* pause sync, use `onFirstSubscribe`/`onLastUnsubscribe` lifecycle hooks instead.
|
|
33
|
+
*/
|
|
34
|
+
destroy: () => void;
|
|
35
|
+
/** Returns `true` once the store has received its initial state from the engine. */
|
|
36
|
+
hydrated?: () => boolean;
|
|
37
|
+
/**
|
|
38
|
+
* Called when the store's subscriber count goes from 0 to 1. The registration
|
|
39
|
+
* remains active. Use for lazy resource acquisition (e.g., opening a WebSocket).
|
|
40
|
+
*/
|
|
41
|
+
onFirstSubscribe?: () => void;
|
|
42
|
+
/** Registers a one-time callback to run when hydration completes. */
|
|
43
|
+
onHydrated?: (callback: () => void) => void;
|
|
44
|
+
/**
|
|
45
|
+
* Called when the store's subscriber count drops to 0. The registration remains
|
|
46
|
+
* active and `onFirstSubscribe` will fire again on the next subscription.
|
|
47
|
+
* Use for resource cleanup (e.g., closing idle connections).
|
|
48
|
+
*/
|
|
49
|
+
onLastUnsubscribe?: () => void;
|
|
50
|
+
/**
|
|
51
|
+
* Broadcasts a state update to other clients. Set to `null` for engines where
|
|
52
|
+
* publishing is implicit (e.g., `chrome.storage` where the write itself triggers sync).
|
|
53
|
+
*/
|
|
54
|
+
publish: ((update: SyncUpdate<T>) => void) | null;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Interface for multi-client state synchronization. Stores register to send and receive updates.
|
|
58
|
+
*/
|
|
59
|
+
interface SyncEngine {
|
|
60
|
+
/**
|
|
61
|
+
* When `true`, embeds sync metadata (`{ origin, timestamp, fields }`) into persisted
|
|
62
|
+
* storage values. Required for engines that use storage writes as their transport.
|
|
63
|
+
* Only effective when the store is also persisted.
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
readonly injectStorageMetadata?: boolean;
|
|
67
|
+
/** Registers a store for synchronization. Returns a handle to control the sync lifecycle. */
|
|
68
|
+
register: {
|
|
69
|
+
<T extends Record<string, unknown>>(registration: SyncRegistration<T>): SyncHandle<T>;
|
|
70
|
+
(registration: SyncRegistration<Record<string, unknown>>): SyncHandle<Record<string, unknown>>;
|
|
71
|
+
};
|
|
72
|
+
/** Unique identifier for this client session. Used for conflict resolution and filtering self-updates. */
|
|
73
|
+
readonly sessionId: string;
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
//#region src/storage/storageTypes.d.ts
|
|
77
|
+
type StorageValue<S, HideSyncMetadata extends boolean = false> = HideSyncMetadata extends true ? {
|
|
78
|
+
state: S;
|
|
79
|
+
version?: number;
|
|
80
|
+
} : {
|
|
81
|
+
state: S;
|
|
82
|
+
syncMetadata?: {
|
|
83
|
+
origin?: string;
|
|
84
|
+
timestamp?: number;
|
|
85
|
+
fields?: Record<string, number>;
|
|
86
|
+
};
|
|
87
|
+
version?: number;
|
|
88
|
+
};
|
|
89
|
+
//#endregion
|
|
90
|
+
//#region src/types.d.ts
|
|
91
|
+
/**
|
|
92
|
+
* Asynchronous storage interface.
|
|
93
|
+
* Used for Chrome storage and other async storage implementations.
|
|
94
|
+
*/
|
|
95
|
+
type AsyncStorageInterface<SerializedState = unknown> = {
|
|
96
|
+
readonly async: true;
|
|
97
|
+
/**
|
|
98
|
+
* Adapter-level deserializer used when a store does not supply its own.
|
|
99
|
+
* Acts as the default before falling back to the framework implementation.
|
|
100
|
+
*/
|
|
101
|
+
deserializer?<PersistedState>(serializedState: SerializedState): StorageValue<PersistedState>;
|
|
102
|
+
/**
|
|
103
|
+
* Adapter-level serializer used when a store does not supply its own.
|
|
104
|
+
* Acts as the default before falling back to the framework implementation.
|
|
105
|
+
*/
|
|
106
|
+
serializer?<PersistedState>(storageValue: StorageValue<PersistedState>): SerializedState;
|
|
107
|
+
clearAll(): Promise<void>;
|
|
108
|
+
contains(key: string): Promise<boolean>;
|
|
109
|
+
delete(key: string): Promise<void>;
|
|
110
|
+
get(key: string): Promise<SerializedState | undefined>;
|
|
111
|
+
getAllKeys(): Promise<string[]>;
|
|
112
|
+
set(key: string, value: SerializedState): Promise<void>;
|
|
113
|
+
};
|
|
114
|
+
//#endregion
|
|
115
|
+
//#region src/plugins/chrome/chromeStorageAdapter.d.ts
|
|
116
|
+
type AreaName = keyof Pick<typeof chrome.storage, "local" | "managed" | "session" | "sync">;
|
|
117
|
+
type ChromeStorageAdapterOptions = {
|
|
118
|
+
area?: AreaName;
|
|
119
|
+
storageKeyPrefix?: string;
|
|
120
|
+
};
|
|
121
|
+
declare class ChromeStorageAdapter implements AsyncStorageInterface {
|
|
122
|
+
readonly area: AreaName;
|
|
123
|
+
readonly storageKeyPrefix: string;
|
|
124
|
+
readonly async = true;
|
|
125
|
+
readonly deserializer: typeof deserializeChromeStorageValue;
|
|
126
|
+
readonly serializer: typeof serializeChromeStorageValue;
|
|
127
|
+
constructor(options?: ChromeStorageAdapterOptions);
|
|
128
|
+
clearAll(): Promise<void>;
|
|
129
|
+
contains(key: string): Promise<boolean>;
|
|
130
|
+
delete(key: string): Promise<void>;
|
|
131
|
+
getAllKeys(): Promise<string[]>;
|
|
132
|
+
get(key: string): Promise<unknown>;
|
|
133
|
+
set(key: string, value: unknown): Promise<void>;
|
|
134
|
+
private ensureStorage;
|
|
135
|
+
private toStorageKey;
|
|
136
|
+
private listPrefixedKeys;
|
|
137
|
+
private getFromStorage;
|
|
138
|
+
private execute;
|
|
139
|
+
private invokeWithCallbackSupport;
|
|
140
|
+
}
|
|
141
|
+
declare function serializeChromeStorageValue<PersistedState>(storageValue: StorageValue<PersistedState>): unknown;
|
|
142
|
+
declare function deserializeChromeStorageValue<PersistedState>(serializedState: unknown): StorageValue<PersistedState>;
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/plugins/chrome/chromeExtensionSyncEngine.d.ts
|
|
145
|
+
type ChromeExtensionSyncEngineOptions = ChromeStorageAdapterOptions | {
|
|
146
|
+
storage: ChromeStorageAdapter;
|
|
147
|
+
};
|
|
148
|
+
declare class ChromeExtensionSyncEngine implements SyncEngine {
|
|
149
|
+
readonly injectStorageMetadata = true;
|
|
150
|
+
readonly sessionId: string;
|
|
151
|
+
private readonly area;
|
|
152
|
+
private readonly storageKeyPrefix;
|
|
153
|
+
private readonly registrations;
|
|
154
|
+
private isListening;
|
|
155
|
+
constructor(options?: ChromeExtensionSyncEngineOptions);
|
|
156
|
+
destroy(): void;
|
|
157
|
+
register<T extends Record<string, unknown>>(registration: SyncRegistration<T>): SyncHandle<T>;
|
|
158
|
+
private generateSessionId;
|
|
159
|
+
private attachListener;
|
|
160
|
+
private detachListener;
|
|
161
|
+
private onStorageChanged;
|
|
162
|
+
/**
|
|
163
|
+
* Extracts which fields changed in this update.
|
|
164
|
+
* Prefers field-level metadata when available, falls back to full state diff.
|
|
165
|
+
* Does NOT perform conflict resolution - that's handled by syncEnhancer.processUpdate.
|
|
166
|
+
*/
|
|
167
|
+
private extractChangedFields;
|
|
168
|
+
private setRegistration;
|
|
169
|
+
private toStorageKey;
|
|
170
|
+
private parsePersistValue;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/plugins/chrome/createSyncedChromeStorage.d.ts
|
|
174
|
+
/**
|
|
175
|
+
* Creates a synced Chrome storage engine for extension environments.
|
|
176
|
+
* @returns
|
|
177
|
+
* ```ts
|
|
178
|
+
* { engine: ChromeExtensionSyncEngine; storage: ChromeStorageAdapter }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
declare function createSyncedChromeStorage(options?: ChromeStorageAdapterOptions): {
|
|
182
|
+
storage: ChromeStorageAdapter;
|
|
183
|
+
syncEngine: ChromeExtensionSyncEngine;
|
|
184
|
+
};
|
|
185
|
+
//#endregion
|
|
186
|
+
export { type AreaName, ChromeExtensionSyncEngine, type ChromeExtensionSyncEngineOptions, ChromeStorageAdapter, type ChromeStorageAdapterOptions, createSyncedChromeStorage };
|
package/dist/vanilla/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("../web/internal/runtime.js");function t(e,t,n,r){return e}function n(n,r){let i=(0,e.baseStore)(n,r);return t(i,i.getState,i.getInitialState)}function r(n,r=Object.is){let i=(0,e.derivedStore)(n,r);return t(i,i.getSnapshot,void 0)}function i(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}process.env.NODE_ENV,process.env.NODE_ENV;const a=Object.freeze(Object.create(null));function o(){return Object.create(a)}function s(e){return JSON.stringify(l(e))}function c(e){return JSON.parse(e)}function l(e){return typeof e!=`object`||!e?e:Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return t[n]=i(r)?l(r):r,t},o())}const u=Symbol(`stores.queryParamConfig`);function d(e,t){return{[u]:!0,key:t.key,value:e}}function f(n,r,i){let a=(0,e.queryStore)(n,r,i);return t(a,a.getState,a.getInitialState)}function p(n,r,i){let a=(0,e.virtualStore)(n,r,i);return t(a,a.getState,a.getInitialState)}Object.defineProperty(exports,"QueryStatuses",{enumerable:!0,get:function(){return e.QueryStatuses}}),Object.defineProperty(exports,"StoresError",{enumerable:!0,get:function(){return e.StoresError}}),Object.defineProperty(exports,"applyStateUpdate",{enumerable:!0,get:function(){return e.applyStateUpdate}}),Object.defineProperty(exports,"configureStores",{enumerable:!0,get:function(){return e.configureStores}}),exports.createBaseStore=n,exports.createDerivedStore=r,exports.createQueryStore=f,Object.defineProperty(exports,"createStoreActions",{enumerable:!0,get:function(){return e.createStoreActions}}),exports.createVirtualStore=p,Object.defineProperty(exports,"deepEqual",{enumerable:!0,get:function(){return e.deepEqual}}),exports.defaultRetryDelay=e.defaultRetryDelay,Object.defineProperty(exports,"destroyStore",{enumerable:!0,get:function(){return e.destroyStore}}),Object.defineProperty(exports,"destroyStores",{enumerable:!0,get:function(){return e.destroyStores}}),exports.getQueryKey=s,Object.defineProperty(exports,"getStoreName",{enumerable:!0,get:function(){return e.getStoreName}}),Object.defineProperty(exports,"hasGetSnapshot",{enumerable:!0,get:function(){return e.hasGetSnapshot}}),Object.defineProperty(exports,"identity",{enumerable:!0,get:function(){return e.identity}}),Object.defineProperty(exports,"isDerivedStore",{enumerable:!0,get:function(){return e.isDerivedStore}}),Object.defineProperty(exports,"isPersistedStore",{enumerable:!0,get:function(){return e.isPersistedStore}}),Object.defineProperty(exports,"isQueryStore",{enumerable:!0,get:function(){return e.isQueryStore}}),Object.defineProperty(exports,"isVirtualStore",{enumerable:!0,get:function(){return e.isVirtualStore}}),Object.defineProperty(exports,"nullObject",{enumerable:!0,get:function(){return e.nullObject}}),exports.parseQueryKey=c,exports.queryParam=d,Object.defineProperty(exports,"replacer",{enumerable:!0,get:function(){return e.replacer}}),Object.defineProperty(exports,"reviver",{enumerable:!0,get:function(){return e.reviver}}),Object.defineProperty(exports,"shallowEqual",{enumerable:!0,get:function(){return e.shallowEqual}}),Object.defineProperty(exports,"time",{enumerable:!0,get:function(){return e.time}});
|
package/dist/vanilla/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{QueryStatuses as e,StoresError as t,applyStateUpdate as n,baseStore as r,configureStores as i,createStoreActions as a,deepEqual as o,defaultRetryDelay as s,derivedStore as c,destroyStore as l,destroyStores as u,getStoreName as d,hasGetSnapshot as f,identity as p,isDerivedStore as m,isPersistedStore as h,isQueryStore as g,isVirtualStore as _,nullObject as v,queryStore as y,replacer as b,reviver as x,shallowEqual as S,time as C,virtualStore as w}from"../web/internal/runtime.mjs";function T(e,t,n,r){return e}function E(e,t){let n=r(e,t);return T(n,n.getState,n.getInitialState)}function D(e,t=Object.is){let n=c(e,t);return T(n,n.getSnapshot,void 0)}function O(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}process.env.NODE_ENV,process.env.NODE_ENV;const k=Object.freeze(Object.create(null));function A(){return Object.create(k)}function j(e){return JSON.stringify(N(e))}function M(e){return JSON.parse(e)}function N(e){return typeof e!=`object`||!e?e:Object.keys(e).sort().reduce((t,n)=>{let r=e[n];return t[n]=O(r)?N(r):r,t},A())}const P=Symbol(`stores.queryParamConfig`);function F(e,t){return{[P]:!0,key:t.key,value:e}}function I(e,t,n){let r=y(e,t,n);return T(r,r.getState,r.getInitialState)}function L(e,t,n){let r=w(e,t,n);return T(r,r.getState,r.getInitialState)}export{e as QueryStatuses,t as StoresError,n as applyStateUpdate,i as configureStores,E as createBaseStore,D as createDerivedStore,I as createQueryStore,a as createStoreActions,L as createVirtualStore,o as deepEqual,s as defaultRetryDelay,l as destroyStore,u as destroyStores,j as getQueryKey,d as getStoreName,f as hasGetSnapshot,p as identity,m as isDerivedStore,h as isPersistedStore,g as isQueryStore,_ as isVirtualStore,v as nullObject,M as parseQueryKey,F as queryParam,b as replacer,x as reviver,S as shallowEqual,C as time};
|