storion 0.9.0 → 0.10.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/CHANGELOG.md +62 -4
- package/README.md +42 -2021
- package/dist/async/abortable.d.ts +295 -0
- package/dist/async/abortable.d.ts.map +1 -0
- package/dist/async/async.d.ts +86 -5
- package/dist/async/async.d.ts.map +1 -1
- package/dist/async/context.d.ts +15 -0
- package/dist/async/context.d.ts.map +1 -0
- package/dist/async/index.d.ts +16 -3
- package/dist/async/index.d.ts.map +1 -1
- package/dist/async/index.js +407 -137
- package/dist/async/safe.d.ts +221 -0
- package/dist/async/safe.d.ts.map +1 -0
- package/dist/async/types.d.ts +77 -29
- package/dist/async/types.d.ts.map +1 -1
- package/dist/async/wrappers.d.ts +217 -0
- package/dist/async/wrappers.d.ts.map +1 -0
- package/dist/core/effect.d.ts +34 -26
- package/dist/core/effect.d.ts.map +1 -1
- package/dist/core/equality.d.ts +25 -0
- package/dist/core/equality.d.ts.map +1 -1
- package/dist/core/focus.d.ts +20 -0
- package/dist/core/focus.d.ts.map +1 -0
- package/dist/core/focusHelpers.d.ts +258 -0
- package/dist/core/focusHelpers.d.ts.map +1 -0
- package/dist/core/middleware.d.ts +4 -4
- package/dist/core/store.d.ts.map +1 -1
- package/dist/core/storeContext.d.ts +2 -9
- package/dist/core/storeContext.d.ts.map +1 -1
- package/dist/dev.d.ts +0 -10
- package/dist/dev.d.ts.map +1 -1
- package/dist/{index-C8B6Mo8r.js → effect-BDQU8Voz.js} +1241 -583
- package/dist/errors.d.ts +6 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/network/index.d.ts +69 -0
- package/dist/network/index.d.ts.map +1 -0
- package/dist/network/retry.d.ts +53 -0
- package/dist/network/retry.d.ts.map +1 -0
- package/dist/network/services.d.ts +58 -0
- package/dist/network/services.d.ts.map +1 -0
- package/dist/network/store.d.ts +36 -0
- package/dist/network/store.d.ts.map +1 -0
- package/dist/network/utils.d.ts +9 -0
- package/dist/network/utils.d.ts.map +1 -0
- package/dist/persist/index.d.ts +1 -1
- package/dist/persist/index.d.ts.map +1 -1
- package/dist/persist/index.js +11 -9
- package/dist/persist/persist.d.ts +14 -14
- package/dist/persist/persist.d.ts.map +1 -1
- package/dist/pool.d.ts +77 -0
- package/dist/pool.d.ts.map +1 -0
- package/dist/react/index.d.ts +2 -2
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +245 -244
- package/dist/react/stable.d.ts +27 -0
- package/dist/react/stable.d.ts.map +1 -0
- package/dist/react/useStore.d.ts +38 -13
- package/dist/react/useStore.d.ts.map +1 -1
- package/dist/react/withStore.d.ts.map +1 -1
- package/dist/storion.js +911 -37
- package/dist/trigger.d.ts +12 -7
- package/dist/trigger.d.ts.map +1 -1
- package/dist/types.d.ts +133 -22
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/storeTuple.d.ts +7 -0
- package/dist/utils/storeTuple.d.ts.map +1 -0
- package/package.json +5 -1
- package/dist/collection.d.ts +0 -34
- package/dist/collection.d.ts.map +0 -1
- package/dist/core/proxy.d.ts +0 -47
- package/dist/core/proxy.d.ts.map +0 -1
- package/dist/effect-C6h0PDDI.js +0 -446
- package/dist/isPromiseLike-bFkfHAbm.js +0 -6
- package/dist/react/useLocalStore.d.ts +0 -48
- package/dist/react/useLocalStore.d.ts.map +0 -1
package/dist/errors.d.ts
CHANGED
|
@@ -65,4 +65,10 @@ export declare class LocalStoreDependencyError extends StorionError {
|
|
|
65
65
|
export declare class EffectRefreshError extends StorionError {
|
|
66
66
|
constructor();
|
|
67
67
|
}
|
|
68
|
+
/**
|
|
69
|
+
* Thrown when scoped() is called outside of a selector function.
|
|
70
|
+
*/
|
|
71
|
+
export declare class ScopedOutsideSelectorError extends StorionError {
|
|
72
|
+
constructor();
|
|
73
|
+
}
|
|
68
74
|
//# sourceMappingURL=errors.d.ts.map
|
package/dist/errors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAMD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,YAAY;gBAE7C,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM;CAShB;AAMD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBAEnD,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,WAAW,GAAG,QAAQ;CAUpC;AAMD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAI1C;AAMD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAQnD;AAMD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;gBACrC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAOpD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAI3C;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,YAAY;gBAC7C,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAOvD;AAMD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;;CAKnD"}
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,qBAAa,YAAa,SAAQ,KAAK;gBACzB,OAAO,EAAE,MAAM;CAI5B;AAMD;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,YAAY;gBAE7C,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM;CAShB;AAMD;;;GAGG;AACH,qBAAa,qBAAsB,SAAQ,YAAY;gBAEnD,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,WAAW,GAAG,QAAQ;CAUpC;AAMD;;;GAGG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAI1C;AAMD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,OAAO,EAAE,MAAM;CAI5B;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;gBACtC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;CAQnD;AAMD;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;gBACrC,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAOpD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,YAAY;gBACxC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM;CAI3C;AAMD;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,YAAY;gBAC7C,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM;CAOvD;AAMD;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,YAAY;;CAKnD;AAKD;;GAEG;AACH,qBAAa,0BAA2B,SAAQ,YAAY;;CAQ3D"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,19 +3,20 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @packageDocumentation
|
|
5
5
|
*/
|
|
6
|
-
export
|
|
7
|
-
export { is
|
|
6
|
+
export * from './types';
|
|
7
|
+
export { is } from './is';
|
|
8
8
|
export { store } from './core/store';
|
|
9
9
|
export { container } from './core/container';
|
|
10
10
|
export { batch, untrack } from './core/tracking';
|
|
11
|
-
export { createResolver } from './core/createResolver';
|
|
11
|
+
export { createResolver as resolver } from './core/createResolver';
|
|
12
12
|
export { pick } from './core/pick';
|
|
13
|
+
export { list, map, toggle, increment, decrement, multiply, divide, clamp, append, prepend, merge, reset, type ListOptions, type MapOptions, type FocusList, type FocusMap, } from './core/focusHelpers';
|
|
13
14
|
export { effect, type EffectFn, type EffectContext, type EffectOptions, type EffectErrorStrategy, type EffectErrorContext, type EffectRetryConfig, } from './core/effect';
|
|
14
15
|
export { applyFor, applyExcept, forStores, type SpecPattern, type MiddlewareMap, } from './core/middleware';
|
|
15
16
|
export { equality, shallowEqual, deepEqual, strictEqual, } from './core/equality';
|
|
16
17
|
export { trigger, type TriggerOptions } from './trigger';
|
|
17
|
-
export { wrapFn as wrapFn, unwrapFn, isWrappedFn } from './core/fnWrapper';
|
|
18
18
|
export { StorionError, SetupPhaseError, LifetimeMismatchError, AsyncFunctionError, StoreDisposedError, InvalidActionError, HooksContextError, ProviderMissingError, LocalStoreDependencyError, EffectRefreshError, } from './errors';
|
|
19
19
|
export { meta } from './meta/meta';
|
|
20
20
|
export { withMeta } from './meta/withMeta';
|
|
21
|
+
export { pool } from './pool';
|
|
21
22
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,cAAc,SAAS,CAAC;AAGxB,OAAO,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AAG1B,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,EAAE,cAAc,IAAI,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC,OAAO,EACL,IAAI,EACJ,GAAG,EAEH,MAAM,EACN,SAAS,EACT,SAAS,EACT,QAAQ,EACR,MAAM,EACN,KAAK,EACL,MAAM,EACN,OAAO,EACP,KAAK,EACL,KAAK,EAEL,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,MAAM,EACN,KAAK,QAAQ,EACb,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,QAAQ,EACR,WAAW,EACX,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,SAAS,EACT,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,WAAW,CAAC;AAGzD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,kBAAkB,EAClB,kBAAkB,EAClB,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,yBAAyB,EACzB,kBAAkB,GACnB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network connectivity module.
|
|
3
|
+
*
|
|
4
|
+
* Provides platform-agnostic network state management:
|
|
5
|
+
* - `networkStore` - Reactive store with `online` state for React components
|
|
6
|
+
* - `networkService` - Provides `isOnline()`, `waitForOnline()`, and `offlineRetry()` wrapper
|
|
7
|
+
* - `onlineService` - Customizable online/offline event subscription
|
|
8
|
+
* - `pingService` - Customizable network reachability check
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { networkStore, networkService } from 'storion/network';
|
|
13
|
+
* import { abortable, retry } from 'storion/async';
|
|
14
|
+
*
|
|
15
|
+
* // React component - use store for reactive state
|
|
16
|
+
* function NetworkBanner() {
|
|
17
|
+
* const { online } = useStore(({ get }) => {
|
|
18
|
+
* const [state] = get(networkStore);
|
|
19
|
+
* return { online: state.online };
|
|
20
|
+
* });
|
|
21
|
+
* return online ? null : <div>You are offline</div>;
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* // In store setup - use service for logic
|
|
25
|
+
* setup({ get, focus }) {
|
|
26
|
+
* const network = get(networkService);
|
|
27
|
+
*
|
|
28
|
+
* const fetchUsers = abortable(async ({ signal }) => {
|
|
29
|
+
* const res = await fetch('/api/users', { signal });
|
|
30
|
+
* return res.json();
|
|
31
|
+
* });
|
|
32
|
+
*
|
|
33
|
+
* // Chain wrappers: retry 3 times, then wait for network
|
|
34
|
+
* const robustFetch = fetchUsers
|
|
35
|
+
* .use(retry(3))
|
|
36
|
+
* .use(network.offlineRetry());
|
|
37
|
+
*
|
|
38
|
+
* const usersQuery = async.action(focus("users"), robustFetch);
|
|
39
|
+
*
|
|
40
|
+
* return { fetchUsers: usersQuery.dispatch };
|
|
41
|
+
* }
|
|
42
|
+
*
|
|
43
|
+
* // Wait for connectivity
|
|
44
|
+
* const network = get(networkService);
|
|
45
|
+
* await network.waitForOnline();
|
|
46
|
+
* await uploadData();
|
|
47
|
+
*
|
|
48
|
+
* // Override for React Native
|
|
49
|
+
* container.set(onlineService, () => ({
|
|
50
|
+
* isOnline: () => true,
|
|
51
|
+
* subscribe: (listener) => NetInfo.addEventListener(s => listener(!!s.isConnected)),
|
|
52
|
+
* }));
|
|
53
|
+
*
|
|
54
|
+
* // Override for real connectivity check
|
|
55
|
+
* container.set(pingService, () => ({
|
|
56
|
+
* ping: async () => {
|
|
57
|
+
* try {
|
|
58
|
+
* await fetch('/api/health', { method: 'HEAD' });
|
|
59
|
+
* return true;
|
|
60
|
+
* } catch { return false; }
|
|
61
|
+
* },
|
|
62
|
+
* }));
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export { pingService, onlineService, type PingService, type OnlineService, } from './services';
|
|
66
|
+
export { networkStore } from './store';
|
|
67
|
+
export { isNetworkError } from './utils';
|
|
68
|
+
export { networkService, type NetworkService } from './retry';
|
|
69
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/network/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAGH,OAAO,EACL,WAAW,EACX,aAAa,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAGvC,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAGzC,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Resolver } from '../types';
|
|
2
|
+
import { IdentityWrapper } from '../async';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Service for handling network detection and retry logic.
|
|
6
|
+
*
|
|
7
|
+
* Provides:
|
|
8
|
+
* - `isOnline()` - Check current connectivity
|
|
9
|
+
* - `subscribe()` - Listen to online/offline changes
|
|
10
|
+
* - `waitForOnline()` - Promise that resolves when online
|
|
11
|
+
* - `offlineRetry()` - Wrapper for automatic retry on reconnection
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { abortable, retry } from "storion/async";
|
|
16
|
+
* import { networkService } from "storion/network";
|
|
17
|
+
*
|
|
18
|
+
* setup({ get, focus }) {
|
|
19
|
+
* const network = get(networkService);
|
|
20
|
+
*
|
|
21
|
+
* const fetchUsers = abortable(async ({ signal }) => {
|
|
22
|
+
* const res = await fetch("/api/users", { signal });
|
|
23
|
+
* return res.json();
|
|
24
|
+
* });
|
|
25
|
+
*
|
|
26
|
+
* // Chain wrappers: retry 3 times, then wait for network
|
|
27
|
+
* const robustFetch = fetchUsers
|
|
28
|
+
* .use(retry(3))
|
|
29
|
+
* .use(network.offlineRetry());
|
|
30
|
+
*
|
|
31
|
+
* const usersQuery = async.action(focus("users"), robustFetch);
|
|
32
|
+
*
|
|
33
|
+
* return { fetchUsers: usersQuery.dispatch };
|
|
34
|
+
* }
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
export declare const networkService: ({ get }: Resolver) => {
|
|
38
|
+
isOnline: () => boolean;
|
|
39
|
+
subscribe: {
|
|
40
|
+
(listeners: import('..').SingleOrMultipleListeners<boolean>): VoidFunction;
|
|
41
|
+
<TValue>(map: (value: boolean) => {
|
|
42
|
+
value: TValue;
|
|
43
|
+
} | undefined, listeners: import('..').SingleOrMultipleListeners<TValue>): VoidFunction;
|
|
44
|
+
};
|
|
45
|
+
waitForOnline: () => Promise<void>;
|
|
46
|
+
offlineRetry: () => IdentityWrapper;
|
|
47
|
+
dispose: () => void;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Type of the network service instance.
|
|
51
|
+
*/
|
|
52
|
+
export type NetworkService = ReturnType<typeof networkService>;
|
|
53
|
+
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../src/network/retry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAShD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,QAAQ;oBAuCzB,OAAO;;;;;;;yBAoCF,OAAO,CAAC,IAAI,CAAC;wBAkCd,eAAe;mBAmBpB,IAAI;CAWzB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Factory } from '../types';
|
|
2
|
+
|
|
3
|
+
export interface PingService {
|
|
4
|
+
/**
|
|
5
|
+
* Check if the network is reachable.
|
|
6
|
+
* Default: 300ms delay, returns true (optimistic).
|
|
7
|
+
*/
|
|
8
|
+
ping(): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export interface OnlineService {
|
|
11
|
+
/**
|
|
12
|
+
* Get current online status.
|
|
13
|
+
* Default: uses navigator.onLine if available.
|
|
14
|
+
*/
|
|
15
|
+
isOnline(): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Subscribe to online/offline events.
|
|
18
|
+
* Default: uses window 'online'/'offline' events.
|
|
19
|
+
*
|
|
20
|
+
* @returns Unsubscribe function
|
|
21
|
+
*/
|
|
22
|
+
subscribe(listener: (online: boolean) => void): VoidFunction;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Service for checking network reachability.
|
|
26
|
+
*
|
|
27
|
+
* Default implementation: 300ms delay, always returns true (optimistic).
|
|
28
|
+
*
|
|
29
|
+
* Override for real connectivity check:
|
|
30
|
+
* ```ts
|
|
31
|
+
* container.set(pingService, () => ({
|
|
32
|
+
* ping: async () => {
|
|
33
|
+
* try {
|
|
34
|
+
* await fetch('/api/health', { method: 'HEAD' });
|
|
35
|
+
* return true;
|
|
36
|
+
* } catch { return false; }
|
|
37
|
+
* },
|
|
38
|
+
* }));
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare const pingService: Factory<PingService>;
|
|
42
|
+
/**
|
|
43
|
+
* Service for online/offline event subscription.
|
|
44
|
+
*
|
|
45
|
+
* Default implementation: uses browser's navigator.onLine and window events.
|
|
46
|
+
*
|
|
47
|
+
* Override for React Native:
|
|
48
|
+
* ```ts
|
|
49
|
+
* import NetInfo from '@react-native-community/netinfo';
|
|
50
|
+
*
|
|
51
|
+
* container.set(onlineService, () => ({
|
|
52
|
+
* isOnline: () => true,
|
|
53
|
+
* subscribe: (listener) => NetInfo.addEventListener(s => listener(!!s.isConnected)),
|
|
54
|
+
* }));
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export declare const onlineService: Factory<OnlineService>;
|
|
58
|
+
//# sourceMappingURL=services.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"services.d.ts","sourceRoot":"","sources":["../../src/network/services.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAOxC,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,IAAI,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC;IAEpB;;;;;OAKG;IACH,SAAS,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,GAAG,YAAY,CAAC;CAC9D;AAMD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,EAAE,OAAO,CAAC,WAAW,CAO5C,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,aAAa,EAAE,OAAO,CAAC,aAAa,CAwBhD,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reactive network state store.
|
|
3
|
+
*
|
|
4
|
+
* This store consumes `networkService` to provide reactive state for React components.
|
|
5
|
+
* The actual logic lives in `networkService` - this store only syncs the state.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Reactive network state store.
|
|
9
|
+
*
|
|
10
|
+
* Provides reactive `state.online` for UI components.
|
|
11
|
+
* For logic (waitForOnline, offlineRetry), use `networkService` directly.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* // React component - use store for reactive state
|
|
16
|
+
* function NetworkIndicator() {
|
|
17
|
+
* const { online } = useStore(({ get }) => {
|
|
18
|
+
* const [state] = get(networkStore);
|
|
19
|
+
* return { online: state.online };
|
|
20
|
+
* });
|
|
21
|
+
* return online ? '🟢 Online' : '🔴 Offline';
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* // In store setup - use service for logic
|
|
25
|
+
* setup({ get, focus }) {
|
|
26
|
+
* const network = get(networkService);
|
|
27
|
+
* await network.waitForOnline();
|
|
28
|
+
* const robustFetch = fetchUsers.use(network.offlineRetry());
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export declare const networkStore: import('..').StoreSpec<{
|
|
33
|
+
/** Whether the network is currently online */
|
|
34
|
+
online: boolean;
|
|
35
|
+
}, {}>;
|
|
36
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/network/store.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,YAAY;IAGrB,8CAA8C;;MAoBhD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network utility functions.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Check if an error is a network connectivity error.
|
|
6
|
+
* Works across Chrome, Firefox, Safari, React Native, and Apollo Client.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isNetworkError(error: unknown): boolean;
|
|
9
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/network/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAuDtD"}
|
package/dist/persist/index.d.ts
CHANGED
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @packageDocumentation
|
|
7
7
|
*/
|
|
8
|
-
export {
|
|
8
|
+
export { persist, notPersisted, type PersistOptions, type PersistLoadResult, } from './persist';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/persist/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/persist/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,YAAY,EACZ,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,WAAW,CAAC"}
|
package/dist/persist/index.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
import { m as meta } from "../meta-40r-AZfe.js";
|
|
2
|
-
|
|
2
|
+
function isPromiseLike(value) {
|
|
3
|
+
return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function";
|
|
4
|
+
}
|
|
3
5
|
const notPersisted = meta();
|
|
4
|
-
function
|
|
6
|
+
function persist(options) {
|
|
5
7
|
const { filter, fields, handler, onError, force = false } = options;
|
|
6
8
|
return (context) => {
|
|
7
9
|
const { next, meta: meta2 } = context;
|
|
8
10
|
const instance = next();
|
|
9
|
-
|
|
11
|
+
const persistContext = {
|
|
12
|
+
...context,
|
|
13
|
+
store: instance
|
|
14
|
+
};
|
|
15
|
+
if (filter && !filter(persistContext)) {
|
|
10
16
|
return instance;
|
|
11
17
|
}
|
|
12
18
|
const notPersistedInfo = meta2(notPersisted);
|
|
@@ -18,7 +24,7 @@ function persistMiddleware(options) {
|
|
|
18
24
|
(field) => notPersistedInfo.fields[field] === true
|
|
19
25
|
)
|
|
20
26
|
);
|
|
21
|
-
const stateFields = (fields == null ? void 0 : fields(
|
|
27
|
+
const stateFields = (fields == null ? void 0 : fields(persistContext)) ?? context.spec.fields;
|
|
22
28
|
if (stateFields.length === 0) {
|
|
23
29
|
return instance;
|
|
24
30
|
}
|
|
@@ -38,10 +44,6 @@ function persistMiddleware(options) {
|
|
|
38
44
|
}
|
|
39
45
|
return filtered;
|
|
40
46
|
};
|
|
41
|
-
const persistContext = {
|
|
42
|
-
...context,
|
|
43
|
-
store: instance
|
|
44
|
-
};
|
|
45
47
|
const setupPersistence = (persistHandler) => {
|
|
46
48
|
const { load, save } = persistHandler;
|
|
47
49
|
const hydrateWithState = (state) => {
|
|
@@ -99,5 +101,5 @@ function persistMiddleware(options) {
|
|
|
99
101
|
}
|
|
100
102
|
export {
|
|
101
103
|
notPersisted,
|
|
102
|
-
|
|
104
|
+
persist
|
|
103
105
|
};
|
|
@@ -73,18 +73,18 @@ export interface PersistOptions {
|
|
|
73
73
|
* Filter which stores should be persisted.
|
|
74
74
|
* If not provided, all stores are persisted.
|
|
75
75
|
*
|
|
76
|
-
* @param context - The
|
|
76
|
+
* @param context - The persist context with store instance
|
|
77
77
|
* @returns true to persist, false to skip
|
|
78
78
|
*/
|
|
79
|
-
filter?: (context:
|
|
79
|
+
filter?: (context: PersistContext) => boolean;
|
|
80
80
|
/**
|
|
81
81
|
* Filter which fields should be persisted.
|
|
82
82
|
* If not provided, all fields are persisted.
|
|
83
83
|
*
|
|
84
|
-
* @param context - The
|
|
84
|
+
* @param context - The persist context with store instance
|
|
85
85
|
* @returns the fields to persist
|
|
86
86
|
*/
|
|
87
|
-
fields?: (context:
|
|
87
|
+
fields?: (context: PersistContext) => string[];
|
|
88
88
|
/**
|
|
89
89
|
* Handler factory that creates load/save operations for each store.
|
|
90
90
|
* Receives context with store instance, returns handler with load/save.
|
|
@@ -141,11 +141,11 @@ export interface PersistOptions {
|
|
|
141
141
|
* @example localStorage (sync handler)
|
|
142
142
|
* ```ts
|
|
143
143
|
* import { container, forStores } from "storion";
|
|
144
|
-
* import {
|
|
144
|
+
* import { persist } from "storion/persist";
|
|
145
145
|
*
|
|
146
146
|
* const app = container({
|
|
147
147
|
* middleware: forStores([
|
|
148
|
-
*
|
|
148
|
+
* persist({
|
|
149
149
|
* handler: (ctx) => {
|
|
150
150
|
* const key = `app:${ctx.displayName}`;
|
|
151
151
|
* return {
|
|
@@ -161,7 +161,7 @@ export interface PersistOptions {
|
|
|
161
161
|
*
|
|
162
162
|
* @example IndexedDB (async handler)
|
|
163
163
|
* ```ts
|
|
164
|
-
*
|
|
164
|
+
* persist({
|
|
165
165
|
* handler: async (ctx) => {
|
|
166
166
|
* const db = await openDB('app-db', 1, {
|
|
167
167
|
* upgrade(db) { db.createObjectStore('stores'); },
|
|
@@ -176,7 +176,7 @@ export interface PersistOptions {
|
|
|
176
176
|
*
|
|
177
177
|
* @example With shared debounce
|
|
178
178
|
* ```ts
|
|
179
|
-
*
|
|
179
|
+
* persist({
|
|
180
180
|
* handler: (ctx) => {
|
|
181
181
|
* const key = `app:${ctx.displayName}`;
|
|
182
182
|
* const debouncedSave = debounce(
|
|
@@ -193,13 +193,13 @@ export interface PersistOptions {
|
|
|
193
193
|
*
|
|
194
194
|
* @example Multi-storage with meta
|
|
195
195
|
* ```ts
|
|
196
|
-
* const
|
|
197
|
-
* const
|
|
196
|
+
* const inSession = meta();
|
|
197
|
+
* const inLocal = meta();
|
|
198
198
|
*
|
|
199
199
|
* // Session storage middleware
|
|
200
|
-
*
|
|
201
|
-
* filter: ({ meta }) => meta.any(
|
|
202
|
-
* fields: ({ meta }) => meta.fields(
|
|
200
|
+
* persist({
|
|
201
|
+
* filter: ({ meta }) => meta.any(inSession),
|
|
202
|
+
* fields: ({ meta }) => meta.fields(inSession),
|
|
203
203
|
* handler: (ctx) => {
|
|
204
204
|
* const key = `session:${ctx.displayName}`;
|
|
205
205
|
* return {
|
|
@@ -210,5 +210,5 @@ export interface PersistOptions {
|
|
|
210
210
|
* });
|
|
211
211
|
* ```
|
|
212
212
|
*/
|
|
213
|
-
export declare function
|
|
213
|
+
export declare function persist(options: PersistOptions): StoreMiddleware;
|
|
214
214
|
//# sourceMappingURL=persist.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/persist/persist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,sCAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,yCAAyC;IACzC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,iBAAiB,CAAC;IAE/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"persist.d.ts","sourceRoot":"","sources":["../../src/persist/persist.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,eAAe,EACf,sBAAsB,EACtB,aAAa,EACd,MAAM,UAAU,CAAC;AAIlB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,YAAY,sCAAS,CAAC;AAEnC;;GAEG;AACH,MAAM,MAAM,iBAAiB,GACzB,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvB,IAAI,GACJ,SAAS,GACT,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAExD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,sBAAsB;IAC5D,yCAAyC;IACzC,KAAK,EAAE,aAAa,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,iBAAiB,CAAC;IAE/B;;;;OAIG;IACH,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACjD;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC;IAE9C;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,MAAM,EAAE,CAAC;IAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,OAAO,EAAE,CACP,OAAO,EAAE,cAAc,KACpB,cAAc,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;IAElD;;;;;OAKG;IACH,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,KAAK,IAAI,CAAC;IAExE;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0EG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,eAAe,CAmJhE"}
|
package/dist/pool.d.ts
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { AutoDisposeOptions, Equality } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A lazy-instantiation Map with factory function.
|
|
5
|
+
* Items are created on-demand via `get()`.
|
|
6
|
+
*/
|
|
7
|
+
export interface Pool<TKey, TValue> {
|
|
8
|
+
(key: TKey): TValue;
|
|
9
|
+
/** Call callback if key exists (does NOT create item). Chainable. */
|
|
10
|
+
tap(key: TKey, callback: (item: TValue) => void): this;
|
|
11
|
+
/** Check if key exists (does NOT create item). */
|
|
12
|
+
has(key: TKey): boolean;
|
|
13
|
+
/** Get item by key, creating it via factory if it doesn't exist. */
|
|
14
|
+
get(key: TKey): TValue;
|
|
15
|
+
/** Explicitly set an item. Chainable. */
|
|
16
|
+
set(key: TKey, value: TValue): this;
|
|
17
|
+
/** Number of items in the pool. */
|
|
18
|
+
size(): number;
|
|
19
|
+
/** Remove all items. Calls dispose if autoDispose enabled. Chainable. */
|
|
20
|
+
clear(): this;
|
|
21
|
+
/** Remove item by key. Calls dispose if autoDispose enabled. Chainable. */
|
|
22
|
+
delete(key: TKey): this;
|
|
23
|
+
/** Iterate over keys. */
|
|
24
|
+
keys(): IterableIterator<TKey>;
|
|
25
|
+
/** Iterate over values. */
|
|
26
|
+
values(): IterableIterator<TValue>;
|
|
27
|
+
/** Iterate over [key, value] pairs. */
|
|
28
|
+
entries(): IterableIterator<[TKey, TValue]>;
|
|
29
|
+
}
|
|
30
|
+
export interface PoolOptions<TKey, TValue> {
|
|
31
|
+
initial?: readonly [TKey, TValue][];
|
|
32
|
+
/**
|
|
33
|
+
* Custom equality function for keys (O(n) lookup).
|
|
34
|
+
* For better performance, use `keyOf` instead.
|
|
35
|
+
*/
|
|
36
|
+
equality?: Equality<TKey>;
|
|
37
|
+
/**
|
|
38
|
+
* Hash function to normalize keys (O(1) lookup).
|
|
39
|
+
* Converts complex keys to a hashable string/number.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* // Object keys hashed by id
|
|
44
|
+
* pool(createUser, { keyOf: (user) => user.id })
|
|
45
|
+
*
|
|
46
|
+
* // Array keys hashed by JSON
|
|
47
|
+
* pool(createItem, { keyOf: JSON.stringify })
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
keyOf?: (key: TKey) => string | number;
|
|
51
|
+
/**
|
|
52
|
+
* Automatically call dispose method of the item when it is removed from the pool.
|
|
53
|
+
*/
|
|
54
|
+
autoDispose?: AutoDisposeOptions | boolean;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Lazy-instantiation Map wrapper.
|
|
58
|
+
*
|
|
59
|
+
* Creates items on first access via `get()`. Useful for managing
|
|
60
|
+
* pools where items should be created on-demand.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* // Create a pool of emitters, one per property key
|
|
65
|
+
* const emitters = pool((key: string) => emitter<void>());
|
|
66
|
+
*
|
|
67
|
+
* // First access creates the emitter
|
|
68
|
+
* const countEmitter = emitters.get("count"); // creates new emitter
|
|
69
|
+
* const countEmitter2 = emitters.get("count"); // returns same emitter
|
|
70
|
+
* ```
|
|
71
|
+
*
|
|
72
|
+
* @param createItem - Factory function to create new items
|
|
73
|
+
* @param optionsOrInitial - Optional options or initial entries
|
|
74
|
+
* @returns A Map-like object with lazy instantiation on `get()`
|
|
75
|
+
*/
|
|
76
|
+
export declare function pool<TValue, TKey = unknown>(createItem: (key: TKey) => TValue, optionsOrInitial?: PoolOptions<TKey, TValue> | readonly [TKey, TValue][]): Pool<TKey, TValue>;
|
|
77
|
+
//# sourceMappingURL=pool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,IAAI,CAAC,IAAI,EAAE,MAAM;IAChC,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IACpB,qEAAqE;IACrE,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;IACvD,kDAAkD;IAClD,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC;IACxB,oEAAoE;IACpE,GAAG,CAAC,GAAG,EAAE,IAAI,GAAG,MAAM,CAAC;IACvB,yCAAyC;IACzC,GAAG,CAAC,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,mCAAmC;IACnC,IAAI,IAAI,MAAM,CAAC;IACf,yEAAyE;IACzE,KAAK,IAAI,IAAI,CAAC;IACd,2EAA2E;IAC3E,MAAM,CAAC,GAAG,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,yBAAyB;IACzB,IAAI,IAAI,gBAAgB,CAAC,IAAI,CAAC,CAAC;IAC/B,2BAA2B;IAC3B,MAAM,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACnC,uCAAuC;IACvC,OAAO,IAAI,gBAAgB,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,WAAW,CAAC,IAAI,EAAE,MAAM;IACvC,OAAO,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,CAAC;IACpC;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1B;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,GAAG,MAAM,CAAC;IAEvC;;OAEG;IACH,WAAW,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,OAAO,EACzC,UAAU,EAAE,CAAC,GAAG,EAAE,IAAI,KAAK,MAAM,EACjC,gBAAgB,CAAC,EAAE,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,GACvE,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,CA6LpB"}
|
package/dist/react/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export { StoreProvider, useContainer } from './context';
|
|
7
7
|
export { useStore } from './useStore';
|
|
8
|
-
export { type
|
|
9
|
-
export { withStore, createWithStore, type WithStoreHook, type WithStoreRender, type WithStoreRenderWithRef, type WithStoreOptions, type BoundWithStore, type GenericWithStoreHook, type UseContextHook, } from './withStore';
|
|
8
|
+
export { withStore, type WithStoreHook, type WithStoreRender, type WithStoreRenderWithRef, type WithStoreOptions, type BoundWithStore, type GenericWithStoreHook, type UseContextHook, } from './withStore';
|
|
10
9
|
export { create, type CreateSelector, type UseCreatedStore, type CreateResult, type CreatedStoreContext, type WithCreatedStore, } from './create';
|
|
10
|
+
export { stable, type PropEqualityConfig } from './stable';
|
|
11
11
|
export * from '../index';
|
|
12
12
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAGxD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EACL,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EACzB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,MAAM,EACN,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,MAAM,EAAE,KAAK,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG3D,cAAc,UAAU,CAAC"}
|