storion 0.11.1 → 0.11.2
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/async/async.d.ts +31 -0
- package/dist/async/async.d.ts.map +1 -1
- package/dist/async/index.js +8 -601
- package/dist/async/safe.d.ts +0 -12
- package/dist/async/safe.d.ts.map +1 -1
- package/dist/{effect-1beiYe_c.js → effect-BfoYEdFF.js} +686 -61
- package/dist/isPromiseLike-bFkfHAbm.js +6 -0
- package/dist/persist/index.js +1 -3
- package/dist/react/index.js +11 -11
- package/dist/storion.js +15 -15
- package/package.json +1 -1
package/dist/persist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { m as meta } from "../meta-40r-AZfe.js";
|
|
2
|
-
|
|
3
|
-
return typeof value === "object" && value !== null && "then" in value && typeof value.then === "function";
|
|
4
|
-
}
|
|
2
|
+
import { i as isPromiseLike } from "../isPromiseLike-bFkfHAbm.js";
|
|
5
3
|
const notPersisted = meta();
|
|
6
4
|
function persist(options) {
|
|
7
5
|
const { filter, fields, handler, onError, force = false } = options;
|
package/dist/react/index.js
CHANGED
|
@@ -4,11 +4,11 @@ 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, w as withHooks,
|
|
8
|
-
import { E, H, I, L,
|
|
7
|
+
import { P as ProviderMissingError, w as withHooks, e as AsyncFunctionError, t as tryStabilize, s as strictEqual, S as ScopedOutsideSelectorError, f as storeTuple, g as isSpec, h as STORION_TYPE, j as dev, k as resolveEquality, l as store } from "../effect-BfoYEdFF.js";
|
|
8
|
+
import { E, H, I, L, C, z, B, y, n, x, o, q, m, p, D, v, u } from "../effect-BfoYEdFF.js";
|
|
9
9
|
import { e as emitter } from "../emitter-j4rC71vY.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
import { m } from "../meta-40r-AZfe.js";
|
|
11
|
+
import { m as m2 } from "../meta-40r-AZfe.js";
|
|
12
12
|
const StoreContext = createContext(null);
|
|
13
13
|
const StoreProvider = memo(
|
|
14
14
|
({ container: value, children }) => {
|
|
@@ -409,17 +409,17 @@ export {
|
|
|
409
409
|
H as HooksContextError,
|
|
410
410
|
I as InvalidActionError,
|
|
411
411
|
L as LifetimeMismatchError,
|
|
412
|
-
|
|
412
|
+
C as LocalStoreDependencyError,
|
|
413
413
|
ProviderMissingError,
|
|
414
414
|
STORION_TYPE,
|
|
415
|
-
|
|
416
|
-
|
|
415
|
+
z as SetupPhaseError,
|
|
416
|
+
B as StoreDisposedError,
|
|
417
417
|
StoreProvider,
|
|
418
418
|
y as StorionError,
|
|
419
419
|
append,
|
|
420
420
|
applyExcept,
|
|
421
421
|
applyFor,
|
|
422
|
-
|
|
422
|
+
n as batch,
|
|
423
423
|
clamp,
|
|
424
424
|
container,
|
|
425
425
|
create,
|
|
@@ -427,19 +427,19 @@ export {
|
|
|
427
427
|
x as deepEqual,
|
|
428
428
|
disposalGroup,
|
|
429
429
|
divide,
|
|
430
|
-
|
|
430
|
+
o as effect,
|
|
431
431
|
q as equality,
|
|
432
432
|
forStores,
|
|
433
433
|
getNamedGroup,
|
|
434
434
|
increment,
|
|
435
|
-
|
|
435
|
+
m as is,
|
|
436
436
|
list,
|
|
437
437
|
map,
|
|
438
438
|
merge,
|
|
439
|
-
|
|
439
|
+
m2 as meta,
|
|
440
440
|
multiply,
|
|
441
441
|
p as pick,
|
|
442
|
-
|
|
442
|
+
D as pool,
|
|
443
443
|
prepend,
|
|
444
444
|
reset,
|
|
445
445
|
resolver,
|
package/dist/storion.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { F as tryDispose, g as isSpec, u as untrack, h as STORION_TYPE, n as batch, G as unwrapFn, v as shallowEqual, k as resolveEquality } from "./effect-BfoYEdFF.js";
|
|
2
|
+
import { e, E, H, I, L, C, P, z, B, y, x, o, q, m, p, D, l, s } from "./effect-BfoYEdFF.js";
|
|
3
3
|
import { e as emitter } from "./emitter-j4rC71vY.js";
|
|
4
|
-
import { m } from "./meta-40r-AZfe.js";
|
|
4
|
+
import { m as m2 } from "./meta-40r-AZfe.js";
|
|
5
5
|
function createMetaQuery(entries) {
|
|
6
6
|
const entryArray = Array.isArray(entries) ? entries : entries ? [entries] : [];
|
|
7
7
|
const single = (type) => {
|
|
@@ -557,7 +557,7 @@ function list(options) {
|
|
|
557
557
|
}
|
|
558
558
|
}
|
|
559
559
|
if (removed.length === 0) return 0;
|
|
560
|
-
const sortedIndices = [...indicesToRemove].sort((
|
|
560
|
+
const sortedIndices = [...indicesToRemove].sort((a, b) => b - a);
|
|
561
561
|
batch(() => {
|
|
562
562
|
setter((draft) => {
|
|
563
563
|
const arr = draft ?? [];
|
|
@@ -597,7 +597,7 @@ function list(options) {
|
|
|
597
597
|
}
|
|
598
598
|
}
|
|
599
599
|
if (removed.length === 0) return 0;
|
|
600
|
-
const sortedIndices = [...indicesToRemove].sort((
|
|
600
|
+
const sortedIndices = [...indicesToRemove].sort((a, b) => b - a);
|
|
601
601
|
batch(() => {
|
|
602
602
|
setter((draft) => {
|
|
603
603
|
const arr = draft ?? [];
|
|
@@ -1106,16 +1106,16 @@ function withMeta(factory, meta) {
|
|
|
1106
1106
|
});
|
|
1107
1107
|
}
|
|
1108
1108
|
export {
|
|
1109
|
-
|
|
1109
|
+
e as AsyncFunctionError,
|
|
1110
1110
|
E as EffectRefreshError,
|
|
1111
1111
|
H as HooksContextError,
|
|
1112
1112
|
I as InvalidActionError,
|
|
1113
1113
|
L as LifetimeMismatchError,
|
|
1114
|
-
|
|
1114
|
+
C as LocalStoreDependencyError,
|
|
1115
1115
|
P as ProviderMissingError,
|
|
1116
1116
|
STORION_TYPE,
|
|
1117
|
-
|
|
1118
|
-
|
|
1117
|
+
z as SetupPhaseError,
|
|
1118
|
+
B as StoreDisposedError,
|
|
1119
1119
|
y as StorionError,
|
|
1120
1120
|
append,
|
|
1121
1121
|
applyExcept,
|
|
@@ -1127,25 +1127,25 @@ export {
|
|
|
1127
1127
|
x as deepEqual,
|
|
1128
1128
|
disposalGroup,
|
|
1129
1129
|
divide,
|
|
1130
|
-
|
|
1130
|
+
o as effect,
|
|
1131
1131
|
q as equality,
|
|
1132
1132
|
forStores,
|
|
1133
1133
|
getNamedGroup,
|
|
1134
1134
|
increment,
|
|
1135
|
-
|
|
1135
|
+
m as is,
|
|
1136
1136
|
list,
|
|
1137
1137
|
map,
|
|
1138
1138
|
merge,
|
|
1139
|
-
|
|
1139
|
+
m2 as meta,
|
|
1140
1140
|
multiply,
|
|
1141
1141
|
p as pick,
|
|
1142
|
-
|
|
1142
|
+
D as pool,
|
|
1143
1143
|
prepend,
|
|
1144
1144
|
reset,
|
|
1145
1145
|
createResolver as resolver,
|
|
1146
1146
|
shallowEqual,
|
|
1147
|
-
|
|
1148
|
-
|
|
1147
|
+
l as store,
|
|
1148
|
+
s as strictEqual,
|
|
1149
1149
|
toggle,
|
|
1150
1150
|
trigger,
|
|
1151
1151
|
untrack,
|