storion 0.10.1 → 0.11.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/README.md +78 -104
- package/dist/async/abortable.d.ts.map +1 -1
- package/dist/async/index.js +2 -2
- package/dist/async/safe.d.ts +16 -0
- package/dist/async/safe.d.ts.map +1 -1
- package/dist/core/disposalGroup.d.ts +95 -0
- package/dist/core/disposalGroup.d.ts.map +1 -0
- package/dist/core/focusHelpers.d.ts +9 -161
- package/dist/core/focusHelpers.d.ts.map +1 -1
- package/dist/core/list.d.ts +167 -0
- package/dist/core/list.d.ts.map +1 -0
- package/dist/core/map.d.ts +153 -0
- package/dist/core/map.d.ts.map +1 -0
- package/dist/dev.d.ts +40 -39
- package/dist/dev.d.ts.map +1 -1
- package/dist/{effect-BDQU8Voz.js → effect-1beiYe_c.js} +41 -42
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/react/index.js +18 -16
- package/dist/react/useStore.d.ts.map +1 -1
- package/dist/storion.js +438 -205
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -3,12 +3,12 @@ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { en
|
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
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
|
-
import { append, applyExcept, applyFor, clamp, decrement, divide, forStores, increment, list, map, merge, multiply, prepend, reset, resolver, toggle, trigger, withMeta } from "../storion.js";
|
|
7
|
-
import { P as ProviderMissingError, w as withHooks, d as AsyncFunctionError, t as tryStabilize, h as strictEqual, j as ScopedOutsideSelectorError, s as storeTuple, i as isSpec, k as STORION_TYPE, l as resolveEquality, a as store } from "../effect-
|
|
8
|
-
import { E, H, I, L,
|
|
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, w as withHooks, d as AsyncFunctionError, t as tryStabilize, h as strictEqual, j as ScopedOutsideSelectorError, s as storeTuple, i as isSpec, k as STORION_TYPE, l as dev, m as resolveEquality, a as store } from "../effect-1beiYe_c.js";
|
|
8
|
+
import { E, H, I, L, B, S, z, y, o, x, e, q, n, p, C, v, u } from "../effect-1beiYe_c.js";
|
|
9
9
|
import { e as emitter } from "../emitter-j4rC71vY.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
import { m
|
|
11
|
+
import { m } from "../meta-40r-AZfe.js";
|
|
12
12
|
const StoreContext = createContext(null);
|
|
13
13
|
const StoreProvider = memo(
|
|
14
14
|
({ container: value, children }) => {
|
|
@@ -181,8 +181,8 @@ function useStore(selector) {
|
|
|
181
181
|
return useStoreWithContainer(selector, container2);
|
|
182
182
|
}
|
|
183
183
|
const isServer = typeof window === "undefined";
|
|
184
|
-
const useIsomorphicLayoutEffect = isServer ? useEffect : useLayoutEffect;
|
|
185
|
-
const shouldScheduleDispose = !isServer && typeof useLayoutEffect === "function";
|
|
184
|
+
const useIsomorphicLayoutEffect = isServer || !dev() ? useEffect : useLayoutEffect;
|
|
185
|
+
const shouldScheduleDispose = !isServer && dev() && typeof useLayoutEffect === "function";
|
|
186
186
|
class ScopeController {
|
|
187
187
|
constructor(container2) {
|
|
188
188
|
/** Whether the effect has committed (is active) */
|
|
@@ -409,39 +409,41 @@ export {
|
|
|
409
409
|
H as HooksContextError,
|
|
410
410
|
I as InvalidActionError,
|
|
411
411
|
L as LifetimeMismatchError,
|
|
412
|
-
|
|
412
|
+
B as LocalStoreDependencyError,
|
|
413
413
|
ProviderMissingError,
|
|
414
414
|
STORION_TYPE,
|
|
415
415
|
S as SetupPhaseError,
|
|
416
|
-
|
|
416
|
+
z as StoreDisposedError,
|
|
417
417
|
StoreProvider,
|
|
418
|
-
|
|
418
|
+
y as StorionError,
|
|
419
419
|
append,
|
|
420
420
|
applyExcept,
|
|
421
421
|
applyFor,
|
|
422
|
-
|
|
422
|
+
o as batch,
|
|
423
423
|
clamp,
|
|
424
424
|
container,
|
|
425
425
|
create,
|
|
426
426
|
decrement,
|
|
427
|
-
|
|
427
|
+
x as deepEqual,
|
|
428
|
+
disposalGroup,
|
|
428
429
|
divide,
|
|
429
430
|
e as effect,
|
|
430
|
-
|
|
431
|
+
q as equality,
|
|
431
432
|
forStores,
|
|
433
|
+
getNamedGroup,
|
|
432
434
|
increment,
|
|
433
|
-
|
|
435
|
+
n as is,
|
|
434
436
|
list,
|
|
435
437
|
map,
|
|
436
438
|
merge,
|
|
437
|
-
|
|
439
|
+
m as meta,
|
|
438
440
|
multiply,
|
|
439
441
|
p as pick,
|
|
440
|
-
|
|
442
|
+
C as pool,
|
|
441
443
|
prepend,
|
|
442
444
|
reset,
|
|
443
445
|
resolver,
|
|
444
|
-
|
|
446
|
+
v as shallowEqual,
|
|
445
447
|
stable,
|
|
446
448
|
store,
|
|
447
449
|
strictEqual,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../../src/react/useStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAKL,KAAK,cAAc,EAEnB,KAAK,QAAQ,EACb,KAAK,YAAY,EAElB,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"useStore.d.ts","sourceRoot":"","sources":["../../src/react/useStore.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAWH,OAAO,EAKL,KAAK,cAAc,EAEnB,KAAK,QAAQ,EACb,KAAK,YAAY,EAElB,MAAM,UAAU,CAAC;AA8BlB;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,SAAS,MAAM,EACpD,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EACrB,SAAS,EAAE,cAAc,GACxB,YAAY,CAAC,CAAC,CAAC,CAyNjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,MAAM,EACvC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,GACpB,YAAY,CAAC,CAAC,CAAC,CAKjB"}
|