@solidjs/signals 0.13.4 → 0.13.5
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/dev.js +95 -59
- package/dist/node.cjs +342 -311
- package/dist/prod.js +123 -92
- package/dist/types/core/index.d.ts +1 -1
- package/dist/types/core/owner.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/signals.d.ts +2 -0
- package/dist/types/store/projection.d.ts +1 -0
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -166,10 +166,10 @@ function runLaneEffects(e) {
|
|
|
166
166
|
function queueStashedOptimisticEffects(e) {
|
|
167
167
|
for (let t = e.I; t !== null; t = t.p) {
|
|
168
168
|
const e = t.h;
|
|
169
|
-
if (!e.
|
|
170
|
-
if (e.
|
|
171
|
-
if (!e.
|
|
172
|
-
e.
|
|
169
|
+
if (!e.W) continue;
|
|
170
|
+
if (e.W === EFFECT_TRACKED) {
|
|
171
|
+
if (!e.H) {
|
|
172
|
+
e.H = true;
|
|
173
173
|
e.F.enqueue(EFFECT_USER, e.M);
|
|
174
174
|
}
|
|
175
175
|
continue;
|
|
@@ -452,9 +452,9 @@ function insertSubs(e, t = false) {
|
|
|
452
452
|
r.h.q = undefined;
|
|
453
453
|
}
|
|
454
454
|
const e = r.h;
|
|
455
|
-
if (e.
|
|
456
|
-
if (!e.
|
|
457
|
-
e.
|
|
455
|
+
if (e.W === EFFECT_TRACKED) {
|
|
456
|
+
if (!e.H) {
|
|
457
|
+
e.H = true;
|
|
458
458
|
e.F.enqueue(EFFECT_USER, e.M);
|
|
459
459
|
}
|
|
460
460
|
continue;
|
|
@@ -471,7 +471,7 @@ function commitPendingNodes() {
|
|
|
471
471
|
if (n.X !== NOT_PENDING) {
|
|
472
472
|
n.J = n.X;
|
|
473
473
|
n.X = NOT_PENDING;
|
|
474
|
-
if (n.
|
|
474
|
+
if (n.W && n.W !== EFFECT_TRACKED) n.H = true;
|
|
475
475
|
}
|
|
476
476
|
if (!(n.Se & STATUS_PENDING)) n.Se &= ~STATUS_UNINITIALIZED;
|
|
477
477
|
if (n.L) GlobalQueue.ue(n, false, true);
|
|
@@ -685,10 +685,10 @@ function settlePendingSource(e) {
|
|
|
685
685
|
setPendingError(i);
|
|
686
686
|
updatePendingSignal(i);
|
|
687
687
|
if (i.he) {
|
|
688
|
-
if (i.
|
|
688
|
+
if (i.W === EFFECT_TRACKED) {
|
|
689
689
|
const e = i;
|
|
690
|
-
if (!e.
|
|
691
|
-
e.
|
|
690
|
+
if (!e.H) {
|
|
691
|
+
e.H = true;
|
|
692
692
|
e.F.enqueue(EFFECT_USER, e.M);
|
|
693
693
|
}
|
|
694
694
|
} else {
|
|
@@ -976,10 +976,8 @@ function getObserver() {
|
|
|
976
976
|
function getOwner() {
|
|
977
977
|
return context;
|
|
978
978
|
}
|
|
979
|
-
function
|
|
980
|
-
if (!context)
|
|
981
|
-
return e;
|
|
982
|
-
}
|
|
979
|
+
function cleanup(e) {
|
|
980
|
+
if (!context) return e;
|
|
983
981
|
if (!context.be) context.be = e;
|
|
984
982
|
else if (Array.isArray(context.be)) context.be.push(e);
|
|
985
983
|
else context.be = [context.be, e];
|
|
@@ -1035,8 +1033,8 @@ function unlinkSubs(e) {
|
|
|
1035
1033
|
else {
|
|
1036
1034
|
t.I = i;
|
|
1037
1035
|
if (i === null) {
|
|
1038
|
-
t.
|
|
1039
|
-
t.L && !t.
|
|
1036
|
+
t.Ge?.();
|
|
1037
|
+
t.L && !t.xe && !(t.O & REACTIVE_ZOMBIE) && unobserved(t);
|
|
1040
1038
|
}
|
|
1041
1039
|
}
|
|
1042
1040
|
return n;
|
|
@@ -1096,7 +1094,7 @@ let snapshotCaptureActive = false;
|
|
|
1096
1094
|
let snapshotSources = null;
|
|
1097
1095
|
function ownerInSnapshotScope(e) {
|
|
1098
1096
|
while (e) {
|
|
1099
|
-
if (e.
|
|
1097
|
+
if (e.We) return true;
|
|
1100
1098
|
e = e.i;
|
|
1101
1099
|
}
|
|
1102
1100
|
return false;
|
|
@@ -1106,17 +1104,17 @@ function setSnapshotCapture(e) {
|
|
|
1106
1104
|
if (e && !snapshotSources) snapshotSources = new Set();
|
|
1107
1105
|
}
|
|
1108
1106
|
function markSnapshotScope(e) {
|
|
1109
|
-
e.
|
|
1107
|
+
e.We = true;
|
|
1110
1108
|
}
|
|
1111
1109
|
function releaseSnapshotScope(e) {
|
|
1112
|
-
e.
|
|
1110
|
+
e.We = false;
|
|
1113
1111
|
releaseSubtree(e);
|
|
1114
1112
|
schedule();
|
|
1115
1113
|
}
|
|
1116
1114
|
function releaseSubtree(e) {
|
|
1117
1115
|
let t = e.Ce;
|
|
1118
1116
|
while (t) {
|
|
1119
|
-
if (t.
|
|
1117
|
+
if (t.We) {
|
|
1120
1118
|
t = t.De;
|
|
1121
1119
|
continue;
|
|
1122
1120
|
}
|
|
@@ -1145,7 +1143,7 @@ function clearSnapshots() {
|
|
|
1145
1143
|
snapshotCaptureActive = false;
|
|
1146
1144
|
}
|
|
1147
1145
|
function recompute(e, t = false) {
|
|
1148
|
-
const n = e.
|
|
1146
|
+
const n = e.W;
|
|
1149
1147
|
if (!t) {
|
|
1150
1148
|
if (e.K && (!n || activeTransition) && activeTransition !== e.K)
|
|
1151
1149
|
globalQueue.initTransition(e.K);
|
|
@@ -1267,7 +1265,7 @@ function computed(e, t, n) {
|
|
|
1267
1265
|
Ve: i || undefined,
|
|
1268
1266
|
Ne: n?.equals != null ? n.equals : isEqual,
|
|
1269
1267
|
fe: !!n?.pureWrite,
|
|
1270
|
-
|
|
1268
|
+
Ge: n?.unobserved,
|
|
1271
1269
|
be: null,
|
|
1272
1270
|
F: context?.F ?? globalQueue,
|
|
1273
1271
|
Le: context?.Le ?? defaultContext,
|
|
@@ -1312,7 +1310,7 @@ function computed(e, t, n) {
|
|
|
1312
1310
|
const t = externalSourceConfig.factory(r.L, () => {
|
|
1313
1311
|
setSignal(e, undefined);
|
|
1314
1312
|
});
|
|
1315
|
-
|
|
1313
|
+
cleanup(() => t.dispose());
|
|
1316
1314
|
r.L = n => {
|
|
1317
1315
|
read(e);
|
|
1318
1316
|
return t.track(n);
|
|
@@ -1331,8 +1329,8 @@ function signal(e, t, n = null) {
|
|
|
1331
1329
|
const i = {
|
|
1332
1330
|
Ne: t?.equals != null ? t.equals : isEqual,
|
|
1333
1331
|
fe: !!t?.pureWrite,
|
|
1334
|
-
|
|
1335
|
-
|
|
1332
|
+
He: !!t?.He,
|
|
1333
|
+
Ge: t?.unobserved,
|
|
1336
1334
|
J: e,
|
|
1337
1335
|
I: null,
|
|
1338
1336
|
ke: null,
|
|
@@ -1342,7 +1340,7 @@ function signal(e, t, n = null) {
|
|
|
1342
1340
|
X: NOT_PENDING
|
|
1343
1341
|
};
|
|
1344
1342
|
n && (n.A = i);
|
|
1345
|
-
if (snapshotCaptureActive && !i.
|
|
1343
|
+
if (snapshotCaptureActive && !i.He && !((n?.Se ?? 0) & STATUS_PENDING)) {
|
|
1346
1344
|
i.Te = e === undefined ? NO_SNAPSHOT : e;
|
|
1347
1345
|
snapshotSources.add(i);
|
|
1348
1346
|
}
|
|
@@ -1401,8 +1399,14 @@ function read(e) {
|
|
|
1401
1399
|
const t = e.V;
|
|
1402
1400
|
const n = pendingCheckActive;
|
|
1403
1401
|
pendingCheckActive = false;
|
|
1404
|
-
if (
|
|
1405
|
-
|
|
1402
|
+
if (t && e.ee !== undefined) {
|
|
1403
|
+
if (e.ee !== NOT_PENDING && (t.Ae || !!(t.Se & STATUS_PENDING))) {
|
|
1404
|
+
foundPending = true;
|
|
1405
|
+
}
|
|
1406
|
+
} else {
|
|
1407
|
+
if (read(getPendingSignal(e))) foundPending = true;
|
|
1408
|
+
if (t && read(getPendingSignal(t))) foundPending = true;
|
|
1409
|
+
}
|
|
1406
1410
|
pendingCheckActive = n;
|
|
1407
1411
|
return e.J;
|
|
1408
1412
|
}
|
|
@@ -1548,6 +1552,9 @@ function computePendingState(e) {
|
|
|
1548
1552
|
}
|
|
1549
1553
|
return true;
|
|
1550
1554
|
}
|
|
1555
|
+
if (e.ee !== undefined && e.ee === NOT_PENDING && !e.Re) {
|
|
1556
|
+
return false;
|
|
1557
|
+
}
|
|
1551
1558
|
if (e.X !== NOT_PENDING && !(t.Se & STATUS_UNINITIALIZED)) return true;
|
|
1552
1559
|
return !!(t.Se & STATUS_PENDING && !(t.Se & STATUS_UNINITIALIZED));
|
|
1553
1560
|
}
|
|
@@ -1667,8 +1674,8 @@ function effect(e, t, n, i, r) {
|
|
|
1667
1674
|
const s = computed(r?.render ? t => staleValues(() => e(t)) : e, i, {
|
|
1668
1675
|
...r,
|
|
1669
1676
|
equals: () => {
|
|
1670
|
-
s.
|
|
1671
|
-
if (o) s.F.enqueue(s.
|
|
1677
|
+
s.H = !s.le;
|
|
1678
|
+
if (o) s.F.enqueue(s.W, runEffect.bind(s));
|
|
1672
1679
|
return false;
|
|
1673
1680
|
},
|
|
1674
1681
|
lazy: true
|
|
@@ -1677,14 +1684,14 @@ function effect(e, t, n, i, r) {
|
|
|
1677
1684
|
s.Me = t;
|
|
1678
1685
|
s.$e = n;
|
|
1679
1686
|
s.je = undefined;
|
|
1680
|
-
s.
|
|
1687
|
+
s.W = r?.render ? EFFECT_RENDER : EFFECT_USER;
|
|
1681
1688
|
s.ge = (e, t) => {
|
|
1682
1689
|
const n = e !== undefined ? e : s.Se;
|
|
1683
1690
|
const i = t !== undefined ? t : s.le;
|
|
1684
1691
|
if (n & STATUS_ERROR) {
|
|
1685
1692
|
let e = i;
|
|
1686
1693
|
s.F.notify(s, STATUS_PENDING, 0);
|
|
1687
|
-
if (s.
|
|
1694
|
+
if (s.W === EFFECT_USER) {
|
|
1688
1695
|
try {
|
|
1689
1696
|
return s.$e
|
|
1690
1697
|
? s.$e(e, () => {
|
|
@@ -1697,17 +1704,17 @@ function effect(e, t, n, i, r) {
|
|
|
1697
1704
|
}
|
|
1698
1705
|
}
|
|
1699
1706
|
if (!s.F.notify(s, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
1700
|
-
} else if (s.
|
|
1707
|
+
} else if (s.W === EFFECT_RENDER) {
|
|
1701
1708
|
s.F.notify(s, STATUS_PENDING | STATUS_ERROR, n, i);
|
|
1702
1709
|
}
|
|
1703
1710
|
};
|
|
1704
1711
|
recompute(s, true);
|
|
1705
|
-
!r?.defer && (s.
|
|
1712
|
+
!r?.defer && (s.W === EFFECT_USER ? s.F.enqueue(s.W, runEffect.bind(s)) : runEffect.call(s));
|
|
1706
1713
|
o = true;
|
|
1707
|
-
|
|
1714
|
+
cleanup(() => s.je?.());
|
|
1708
1715
|
}
|
|
1709
1716
|
function runEffect() {
|
|
1710
|
-
if (!this.
|
|
1717
|
+
if (!this.H || this.O & REACTIVE_DISPOSED) return;
|
|
1711
1718
|
this.je?.();
|
|
1712
1719
|
this.je = undefined;
|
|
1713
1720
|
try {
|
|
@@ -1718,13 +1725,13 @@ function runEffect() {
|
|
|
1718
1725
|
if (!this.F.notify(this, STATUS_ERROR, STATUS_ERROR)) throw e;
|
|
1719
1726
|
} finally {
|
|
1720
1727
|
this.Fe = this.J;
|
|
1721
|
-
this.
|
|
1728
|
+
this.H = false;
|
|
1722
1729
|
}
|
|
1723
1730
|
}
|
|
1724
1731
|
function trackedEffect(e, t) {
|
|
1725
1732
|
const run = () => {
|
|
1726
|
-
if (!n.
|
|
1727
|
-
n.
|
|
1733
|
+
if (!n.H || n.O & REACTIVE_DISPOSED) return;
|
|
1734
|
+
n.H = false;
|
|
1728
1735
|
recompute(n);
|
|
1729
1736
|
};
|
|
1730
1737
|
const n = computed(
|
|
@@ -1738,8 +1745,8 @@ function trackedEffect(e, t) {
|
|
|
1738
1745
|
);
|
|
1739
1746
|
n.je = undefined;
|
|
1740
1747
|
n.Ke = true;
|
|
1741
|
-
n.
|
|
1742
|
-
n.
|
|
1748
|
+
n.H = true;
|
|
1749
|
+
n.W = EFFECT_TRACKED;
|
|
1743
1750
|
n.ge = (e, t) => {
|
|
1744
1751
|
const i = e !== undefined ? e : n.Se;
|
|
1745
1752
|
if (i & STATUS_ERROR) {
|
|
@@ -1750,7 +1757,7 @@ function trackedEffect(e, t) {
|
|
|
1750
1757
|
};
|
|
1751
1758
|
n.M = run;
|
|
1752
1759
|
n.F.enqueue(EFFECT_USER, run);
|
|
1753
|
-
|
|
1760
|
+
cleanup(() => n.je?.());
|
|
1754
1761
|
}
|
|
1755
1762
|
function restoreTransition(e, t) {
|
|
1756
1763
|
globalQueue.initTransition(e);
|
|
@@ -1796,6 +1803,9 @@ function action(e) {
|
|
|
1796
1803
|
step();
|
|
1797
1804
|
});
|
|
1798
1805
|
}
|
|
1806
|
+
function onCleanup(e) {
|
|
1807
|
+
return cleanup(e);
|
|
1808
|
+
}
|
|
1799
1809
|
function accessor(e) {
|
|
1800
1810
|
const t = read.bind(null, e);
|
|
1801
1811
|
t.$r = true;
|
|
@@ -1824,7 +1834,7 @@ function createTrackedEffect(e, t) {
|
|
|
1824
1834
|
}
|
|
1825
1835
|
function createReaction(e, t) {
|
|
1826
1836
|
let n = undefined;
|
|
1827
|
-
|
|
1837
|
+
cleanup(() => n?.());
|
|
1828
1838
|
const i = getOwner();
|
|
1829
1839
|
return r => {
|
|
1830
1840
|
runWithOwner(i, () => {
|
|
@@ -2029,55 +2039,68 @@ function createProjectionInternal(e, t = {}, n) {
|
|
|
2029
2039
|
const o = wrapProjection(t);
|
|
2030
2040
|
i = computed(() => {
|
|
2031
2041
|
const t = getOwner();
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2042
|
+
let i = false;
|
|
2043
|
+
let r;
|
|
2044
|
+
const s = new Proxy(
|
|
2045
|
+
o,
|
|
2046
|
+
createWriteTraps(() => !i || t.Ae === r)
|
|
2047
|
+
);
|
|
2048
|
+
storeSetter(s, s => {
|
|
2049
|
+
r = e(s);
|
|
2050
|
+
i = true;
|
|
2051
|
+
const u = handleAsync(t, r, e => {
|
|
2052
|
+
e !== s && e !== undefined && storeSetter(o, reconcile(e, n?.key || "id"));
|
|
2035
2053
|
});
|
|
2036
|
-
|
|
2054
|
+
u !== s && u !== undefined && reconcile(u, n?.key || "id")(o);
|
|
2037
2055
|
});
|
|
2038
2056
|
});
|
|
2039
|
-
i.
|
|
2057
|
+
i.xe = true;
|
|
2040
2058
|
return { store: o, node: i };
|
|
2041
2059
|
}
|
|
2042
2060
|
function createProjection(e, t = {}, n) {
|
|
2043
2061
|
return createProjectionInternal(e, t, n).store;
|
|
2044
2062
|
}
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2063
|
+
function createWriteTraps(e) {
|
|
2064
|
+
const t = {
|
|
2065
|
+
get(e, n) {
|
|
2066
|
+
let i;
|
|
2067
|
+
setWriteOverride(true);
|
|
2068
|
+
setProjectionWriteActive(true);
|
|
2069
|
+
try {
|
|
2070
|
+
i = e[n];
|
|
2071
|
+
} finally {
|
|
2072
|
+
setWriteOverride(false);
|
|
2073
|
+
setProjectionWriteActive(false);
|
|
2074
|
+
}
|
|
2075
|
+
return typeof i === "object" && i !== null ? new Proxy(i, t) : i;
|
|
2076
|
+
},
|
|
2077
|
+
set(t, n, i) {
|
|
2078
|
+
if (e && !e()) return true;
|
|
2079
|
+
setWriteOverride(true);
|
|
2080
|
+
setProjectionWriteActive(true);
|
|
2081
|
+
try {
|
|
2082
|
+
t[n] = i;
|
|
2083
|
+
} finally {
|
|
2084
|
+
setWriteOverride(false);
|
|
2085
|
+
setProjectionWriteActive(false);
|
|
2086
|
+
}
|
|
2087
|
+
return true;
|
|
2088
|
+
},
|
|
2089
|
+
deleteProperty(t, n) {
|
|
2090
|
+
if (e && !e()) return true;
|
|
2091
|
+
setWriteOverride(true);
|
|
2092
|
+
setProjectionWriteActive(true);
|
|
2093
|
+
try {
|
|
2094
|
+
delete t[n];
|
|
2095
|
+
} finally {
|
|
2096
|
+
setWriteOverride(false);
|
|
2097
|
+
setProjectionWriteActive(false);
|
|
2098
|
+
}
|
|
2099
|
+
return true;
|
|
2077
2100
|
}
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
}
|
|
2101
|
+
};
|
|
2102
|
+
return t;
|
|
2103
|
+
}
|
|
2081
2104
|
const $TRACK = Symbol(0),
|
|
2082
2105
|
$TARGET = Symbol(0),
|
|
2083
2106
|
$PROXY = Symbol(0),
|
|
@@ -2451,24 +2474,32 @@ function createOptimisticProjectionInternal(e, t = {}, n) {
|
|
|
2451
2474
|
if (e) {
|
|
2452
2475
|
i = computed(() => {
|
|
2453
2476
|
const t = getOwner();
|
|
2477
|
+
let i = false;
|
|
2478
|
+
let r;
|
|
2479
|
+
const s = new Proxy(
|
|
2480
|
+
o,
|
|
2481
|
+
createWriteTraps(() => !i || t.Ae === r)
|
|
2482
|
+
);
|
|
2454
2483
|
setProjectionWriteActive(true);
|
|
2455
2484
|
try {
|
|
2456
|
-
storeSetter(
|
|
2457
|
-
|
|
2485
|
+
storeSetter(s, s => {
|
|
2486
|
+
r = e(s);
|
|
2487
|
+
i = true;
|
|
2488
|
+
const u = handleAsync(t, r, e => {
|
|
2458
2489
|
setProjectionWriteActive(true);
|
|
2459
2490
|
try {
|
|
2460
|
-
e !==
|
|
2491
|
+
e !== s && e !== undefined && storeSetter(o, reconcile(e, n?.key || "id"));
|
|
2461
2492
|
} finally {
|
|
2462
2493
|
setProjectionWriteActive(false);
|
|
2463
2494
|
}
|
|
2464
2495
|
});
|
|
2465
|
-
|
|
2496
|
+
u !== s && u !== undefined && reconcile(u, n?.key || "id")(o);
|
|
2466
2497
|
});
|
|
2467
2498
|
} finally {
|
|
2468
2499
|
setProjectionWriteActive(false);
|
|
2469
2500
|
}
|
|
2470
2501
|
});
|
|
2471
|
-
i.
|
|
2502
|
+
i.xe = true;
|
|
2472
2503
|
}
|
|
2473
2504
|
return { store: o, node: i };
|
|
2474
2505
|
}
|
|
@@ -2932,14 +2963,14 @@ function boundaryComputed(e, t) {
|
|
|
2932
2963
|
n.F.notify(n, n.ut, i, r);
|
|
2933
2964
|
};
|
|
2934
2965
|
n.ut = t;
|
|
2935
|
-
n.
|
|
2966
|
+
n.xe = true;
|
|
2936
2967
|
recompute(n, true);
|
|
2937
2968
|
return n;
|
|
2938
2969
|
}
|
|
2939
2970
|
function createBoundChildren(e, t, n, i) {
|
|
2940
2971
|
const r = e.F;
|
|
2941
2972
|
r.addChild((e.F = n));
|
|
2942
|
-
|
|
2973
|
+
cleanup(() => r.removeChild(e.F));
|
|
2943
2974
|
return runWithOwner(e, () => {
|
|
2944
2975
|
const e = computed(t);
|
|
2945
2976
|
return boundaryComputed(() => staleValues(() => flatten(read(e))), i);
|
|
@@ -2949,7 +2980,7 @@ const ON_INIT = Symbol();
|
|
|
2949
2980
|
class CollectionQueue extends Queue {
|
|
2950
2981
|
ct;
|
|
2951
2982
|
ft = new Set();
|
|
2952
|
-
lt = signal(false, { pureWrite: true,
|
|
2983
|
+
lt = signal(false, { pureWrite: true, He: true });
|
|
2953
2984
|
Et = false;
|
|
2954
2985
|
Tt;
|
|
2955
2986
|
dt = ON_INIT;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { ContextNotFoundError, NoOwnerError, NotReadyError } from "./error.js";
|
|
2
2
|
export { isEqual, untrack, runWithOwner, computed, signal, read, setSignal, optimisticSignal, optimisticComputed, isPending, latest, refresh, isRefreshing, staleValues, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots } from "./core.js";
|
|
3
3
|
export { enableExternalSource, _resetExternalSourceConfig, type ExternalSourceFactory, type ExternalSource, type ExternalSourceConfig } from "./external.js";
|
|
4
|
-
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed,
|
|
4
|
+
export { createOwner, createRoot, dispose, getNextChildId, getObserver, getOwner, isDisposed, cleanup, peekNextChildId } from "./owner.js";
|
|
5
5
|
export { createContext, getContext, setContext, type Context, type ContextRecord } from "./context.js";
|
|
6
6
|
export { handleAsync } from "./async.js";
|
|
7
7
|
export type { Computed, Disposable, FirewallSignal, Link, Owner, Root, Signal, NodeOptions } from "./types.js";
|
|
@@ -6,7 +6,7 @@ export declare function getNextChildId(owner: Owner): string;
|
|
|
6
6
|
export declare function peekNextChildId(owner: Owner): string;
|
|
7
7
|
export declare function getObserver(): Owner | null;
|
|
8
8
|
export declare function getOwner(): Owner | null;
|
|
9
|
-
export declare function
|
|
9
|
+
export declare function cleanup(fn: Disposable): Disposable;
|
|
10
10
|
export declare function isDisposed(node: Owner): boolean;
|
|
11
11
|
export declare function createOwner(options?: {
|
|
12
12
|
id?: string;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner,
|
|
1
|
+
export { $REFRESH, ContextNotFoundError, NoOwnerError, NotReadyError, action, createContext, createOwner, createRoot, runWithOwner, flush, getNextChildId, peekNextChildId, getContext, setContext, getOwner, isDisposed, getObserver, isEqual, untrack, isPending, latest, isRefreshing, refresh, SUPPORTS_PROXY, setSnapshotCapture, markSnapshotScope, releaseSnapshotScope, clearSnapshots, enforceLoadingBoundary, enableExternalSource } from "./core/index.js";
|
|
2
2
|
export type { Owner, Context, ContextRecord, IQueue, ExternalSourceFactory, ExternalSource, ExternalSourceConfig } from "./core/index.js";
|
|
3
|
-
export { createSignal, createMemo, createEffect, createRenderEffect, createTrackedEffect, createReaction, createOptimistic, resolve, onSettled } from "./signals.js";
|
|
3
|
+
export { createSignal, createMemo, createEffect, createRenderEffect, createTrackedEffect, createReaction, createOptimistic, resolve, onSettled, onCleanup } from "./signals.js";
|
|
4
4
|
export type { Accessor, Setter, Signal, ComputeFunction, EffectFunction, EffectBundle, EffectOptions, SignalOptions, MemoOptions, NoInfer } from "./signals.js";
|
|
5
5
|
export { mapArray, repeat, type Maybe } from "./map.js";
|
|
6
6
|
export * from "./store/index.js";
|
package/dist/types/signals.d.ts
CHANGED
|
@@ -22,4 +22,5 @@ export declare function createProjectionInternal<T extends object = {}>(fn: (dra
|
|
|
22
22
|
export declare function createProjection<T extends object = {}>(fn: (draft: T) => void | T | Promise<void | T> | AsyncIterable<void | T>, initialValue?: T, options?: ProjectionOptions): Store<T> & {
|
|
23
23
|
[$REFRESH]: any;
|
|
24
24
|
};
|
|
25
|
+
export declare function createWriteTraps(isActive?: () => boolean): ProxyHandler<any>;
|
|
25
26
|
export declare const writeTraps: ProxyHandler<any>;
|