storion 0.14.3 → 0.15.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 +17 -0
- package/dist/async/async.d.ts +2 -10
- package/dist/async/async.d.ts.map +1 -1
- package/dist/async/index.js +2 -2
- package/dist/core/list.d.ts +3 -3
- package/dist/core/map.d.ts +3 -3
- package/dist/{effect-CB289BT8.js → effect-rKIdiLB3.js} +6 -11
- package/dist/react/index.js +2 -2
- package/dist/storion.js +4 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
---
|
|
11
11
|
|
|
12
|
+
## [0.15.0] - 2024-12-27
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- **BREAKING**: Rename `tryGet(key, create)` to `ensure(key, create)` in `list()` and `map()` focus helpers
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## [0.14.4] - 2024-12-27
|
|
21
|
+
|
|
22
|
+
### Changed
|
|
23
|
+
|
|
24
|
+
- **BREAKING**: `async.state()` now returns `PromiseWithState<T>` (promise with attached state) instead of `PromiseState<T>`
|
|
25
|
+
- Removed `async.withState()` - use `async.state()` instead which now attaches state directly to the promise
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
12
29
|
## [0.14.3] - 2024-12-27
|
|
13
30
|
|
|
14
31
|
### Fixed
|
package/dist/async/async.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Focus, MetaEntry, SelectorMixin } from '../types';
|
|
2
|
-
import { AsyncState, AsyncMode, AsyncHandler, AsyncOptions, AsyncActions, CancellablePromise, InferAsyncData, MapAsyncData, MapSettledResult, RaceResult, AsyncKey, AsyncRequestId,
|
|
2
|
+
import { AsyncState, AsyncMode, AsyncHandler, AsyncOptions, AsyncActions, CancellablePromise, InferAsyncData, MapAsyncData, MapSettledResult, RaceResult, AsyncKey, AsyncRequestId, PromiseWithState } from './types';
|
|
3
3
|
import { Abortable } from './abortable';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -195,20 +195,12 @@ export declare namespace async {
|
|
|
195
195
|
* Also considers stale data as "ready" in stale mode.
|
|
196
196
|
*/
|
|
197
197
|
function race<T extends Record<string, AsyncState<any, any>>>(states: T): RaceResult<T>;
|
|
198
|
-
/**
|
|
199
|
-
* Wraps a promise with the state of the promise.
|
|
200
|
-
* @param promise - The promise to get the state of.
|
|
201
|
-
* @returns The promise with the state attached.
|
|
202
|
-
*/
|
|
203
|
-
function withState<T>(promise: PromiseLike<T>): PromiseLike<T> & {
|
|
204
|
-
state: PromiseState<T>;
|
|
205
|
-
};
|
|
206
198
|
/**
|
|
207
199
|
* Get the state of a promise.
|
|
208
200
|
* @param promise - The promise to get the state of.
|
|
209
201
|
* @returns The state of the promise.
|
|
210
202
|
*/
|
|
211
|
-
function state<T>(promise: PromiseLike<T>):
|
|
203
|
+
function state<T>(promise: PromiseLike<T>): PromiseWithState<T>;
|
|
212
204
|
/**
|
|
213
205
|
* Returns all data if all states are ready.
|
|
214
206
|
* In stale mode, stale data counts as ready.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/async/async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,EAET,aAAa,EACd,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EACV,UAAU,EACV,SAAS,EAET,YAAY,EACZ,YAAY,EACZ,YAAY,EAEZ,kBAAkB,EAClB,cAAc,EAEd,YAAY,EACZ,gBAAgB,EAChB,UAAU,EACV,QAAQ,EACR,cAAc,
|
|
1
|
+
{"version":3,"file":"async.d.ts","sourceRoot":"","sources":["../../src/async/async.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,KAAK,EACL,SAAS,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AE,IAAI,EAAE,CAAC,CAAA;KAAE,CAIzC;IAED;;OAEG;IACH,SAAgB,SAAS,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,EAC9C,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GACtB,KAAK,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,MAAM,EAAE,SAAS,CAAA;KAAE,CAEnD;IAED;;OAEG;IACH,SAAgB,OAAO,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,EAC5C,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GACtB,KAAK,IAAI,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG;QAAE,MAAM,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,KAAK,CAAA;KAAE,CAE/D;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+CG;IACH,SAAgB,MAAM,CAAC,CAAC,EAAE,CAAC,SAAS,SAAS,GAAG,OAAO,EACrD,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAC9B,SAAS,EAAE,MAAM,CAAC,GACjB,YAAY,CAoDd;CACF"}
|
package/dist/async/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as retryStrategy } from "../effect-
|
|
2
|
-
import { d, A, b, a, c, i } from "../effect-
|
|
1
|
+
import { r as retryStrategy } from "../effect-rKIdiLB3.js";
|
|
2
|
+
import { d, A, b, a, c, i } from "../effect-rKIdiLB3.js";
|
|
3
3
|
function retry(retriesOrStrategyOrOptions) {
|
|
4
4
|
const options = typeof retriesOrStrategyOrOptions === "number" ? { retries: retriesOrStrategyOrOptions } : typeof retriesOrStrategyOrOptions === "string" ? { delay: retriesOrStrategyOrOptions } : retriesOrStrategyOrOptions ?? {};
|
|
5
5
|
const retries = options.retries ?? 3;
|
package/dist/core/list.d.ts
CHANGED
|
@@ -87,12 +87,12 @@ export interface FocusList<T> {
|
|
|
87
87
|
*/
|
|
88
88
|
set(index: number, itemOrReducerOrUpdater: T | ((prev: T) => T | void)): void;
|
|
89
89
|
/**
|
|
90
|
-
*
|
|
90
|
+
* Ensure item exists at index, creating it if necessary.
|
|
91
91
|
*
|
|
92
92
|
* @example
|
|
93
|
-
* const item = items.
|
|
93
|
+
* const item = items.ensure(5, () => ({ id: 5, name: 'New' }));
|
|
94
94
|
*/
|
|
95
|
-
|
|
95
|
+
ensure(index: number, create: () => T): T;
|
|
96
96
|
/**
|
|
97
97
|
* Swap items at two indices.
|
|
98
98
|
*
|
package/dist/core/map.d.ts
CHANGED
|
@@ -69,12 +69,12 @@ export interface FocusMap<T> {
|
|
|
69
69
|
*/
|
|
70
70
|
set(key: string, valueOrReducerOrUpdater: T | ((prev: T) => T | void)): void;
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
72
|
+
* Ensure value exists at key, creating it if necessary.
|
|
73
73
|
*
|
|
74
74
|
* @example
|
|
75
|
-
* const user = users.
|
|
75
|
+
* const user = users.ensure('user-123', () => ({ id: 'user-123', name: 'New' }));
|
|
76
76
|
*/
|
|
77
|
-
|
|
77
|
+
ensure(key: string, create: () => T): T;
|
|
78
78
|
/**
|
|
79
79
|
* Swap values at two keys.
|
|
80
80
|
*
|
|
@@ -3342,7 +3342,6 @@ function createAsyncContext(abortController, isCancelledOrAborted, cancel, resol
|
|
|
3342
3342
|
};
|
|
3343
3343
|
}
|
|
3344
3344
|
const pendingPromises = /* @__PURE__ */ new WeakMap();
|
|
3345
|
-
const promiseStates = /* @__PURE__ */ new WeakMap();
|
|
3346
3345
|
function getPendingPromise(state) {
|
|
3347
3346
|
if (state.status === "pending" && "__key" in state && state.__key) {
|
|
3348
3347
|
return pendingPromises.get(state.__key);
|
|
@@ -3806,15 +3805,12 @@ var async;
|
|
|
3806
3805
|
);
|
|
3807
3806
|
}
|
|
3808
3807
|
async2.race = race;
|
|
3809
|
-
function withState(promise) {
|
|
3810
|
-
const s = state(promise);
|
|
3811
|
-
return Object.assign(promise, { state: s });
|
|
3812
|
-
}
|
|
3813
|
-
async2.withState = withState;
|
|
3814
3808
|
function state(promise) {
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3809
|
+
if (!isPromiseLike$1(promise)) {
|
|
3810
|
+
throw new Error("Promise is not a PromiseLike");
|
|
3811
|
+
}
|
|
3812
|
+
if ("state" in promise) {
|
|
3813
|
+
return promise;
|
|
3818
3814
|
}
|
|
3819
3815
|
const newState = {
|
|
3820
3816
|
status: "pending",
|
|
@@ -3831,8 +3827,7 @@ var async;
|
|
|
3831
3827
|
newState.rejected = error;
|
|
3832
3828
|
}
|
|
3833
3829
|
);
|
|
3834
|
-
|
|
3835
|
-
return newState;
|
|
3830
|
+
return Object.assign(promise, { state: newState });
|
|
3836
3831
|
}
|
|
3837
3832
|
async2.state = state;
|
|
3838
3833
|
function all(...states) {
|
package/dist/react/index.js
CHANGED
|
@@ -4,8 +4,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
4
4
|
import { memo, useRef, useMemo, createElement, createContext, useContext, useId, useReducer, useState, useEffect, useLayoutEffect, forwardRef } from "react";
|
|
5
5
|
import { container } from "../storion.js";
|
|
6
6
|
import { append, applyExcept, applyFor, clamp, decrement, disposalGroup, divide, forStores, getNamedGroup, increment, list, map, merge, multiply, prepend, reset, resolver, toggle, trigger, withMeta } from "../storion.js";
|
|
7
|
-
import { P as ProviderMissingError, e as isSpec, w as withHooks, f as AsyncFunctionError, t as tryStabilize, s as strictEqual, S as ScopedOutsideSelectorError, g as storeTuple, h as STORION_TYPE, j as dev, k as resolveEquality, l as store } from "../effect-
|
|
8
|
-
import { E, H, I, L, C, z, B, y, n, x, o, q, m, p, D, v, u } from "../effect-
|
|
7
|
+
import { P as ProviderMissingError, e as isSpec, w as withHooks, f as AsyncFunctionError, t as tryStabilize, s as strictEqual, S as ScopedOutsideSelectorError, g as storeTuple, h as STORION_TYPE, j as dev, k as resolveEquality, l as store } from "../effect-rKIdiLB3.js";
|
|
8
|
+
import { E, H, I, L, C, z, B, y, n, x, o, q, m, p, D, v, u } from "../effect-rKIdiLB3.js";
|
|
9
9
|
import { e as emitter } from "../emitter-j4rC71vY.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
import { m as m2 } from "../meta-40r-AZfe.js";
|
package/dist/storion.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as tryDispose, e as isSpec, u as untrack, h as STORION_TYPE, n as batch, G as unwrapFn, v as shallowEqual, k as resolveEquality } from "./effect-
|
|
2
|
-
import { f, E, H, I, L, C, P, z, B, y, x, o, q, m, p, D, l, s } from "./effect-
|
|
1
|
+
import { F as tryDispose, e as isSpec, u as untrack, h as STORION_TYPE, n as batch, G as unwrapFn, v as shallowEqual, k as resolveEquality } from "./effect-rKIdiLB3.js";
|
|
2
|
+
import { f, E, H, I, L, C, P, z, B, y, x, o, q, m, p, D, l, s } from "./effect-rKIdiLB3.js";
|
|
3
3
|
import { e as emitter } from "./emitter-j4rC71vY.js";
|
|
4
4
|
import { m as m2 } from "./meta-40r-AZfe.js";
|
|
5
5
|
function createMetaQuery(entries) {
|
|
@@ -657,7 +657,7 @@ function list(options) {
|
|
|
657
657
|
}
|
|
658
658
|
});
|
|
659
659
|
},
|
|
660
|
-
|
|
660
|
+
ensure(index, create) {
|
|
661
661
|
const currentArray = getArray();
|
|
662
662
|
if (index >= 0 && index < currentArray.length) {
|
|
663
663
|
return currentArray[index];
|
|
@@ -806,7 +806,7 @@ function map(options) {
|
|
|
806
806
|
}
|
|
807
807
|
});
|
|
808
808
|
},
|
|
809
|
-
|
|
809
|
+
ensure(key, create) {
|
|
810
810
|
const currentRecord = getRecord();
|
|
811
811
|
if (key in currentRecord) {
|
|
812
812
|
return currentRecord[key];
|