atom.io 0.9.4 → 0.9.6
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/data/dist/index.js.map +1 -1
- package/data/dist/index.mjs.map +1 -1
- package/data/src/struct-family.ts +8 -6
- package/internal/dist/index.d.mts +3 -2
- package/internal/dist/index.d.ts +3 -2
- package/internal/dist/index.js +16 -3
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/index.mjs +16 -4
- package/internal/dist/index.mjs.map +1 -1
- package/internal/src/caching.ts +16 -0
- package/internal/src/future.ts +1 -1
- package/internal/src/set-state/evict-downstream.ts +2 -3
- package/introspection/dist/index.js.map +1 -1
- package/introspection/dist/index.mjs.map +1 -1
- package/introspection/src/attach-timeline-family.ts +4 -1
- package/introspection/src/attach-transaction-logs.ts +4 -1
- package/json/dist/index.js.map +1 -1
- package/json/dist/index.mjs.map +1 -1
- package/json/src/select-json-family.ts +8 -3
- package/package.json +10 -11
- package/react-devtools/dist/index.js.map +1 -1
- package/react-devtools/dist/index.mjs.map +1 -1
- package/react-devtools/src/StateIndex.tsx +13 -11
package/internal/dist/index.mjs
CHANGED
|
@@ -908,6 +908,9 @@ var cacheValue = (key, value, subject, store = IMPLICIT.STORE) => {
|
|
|
908
908
|
const future = new Future(value);
|
|
909
909
|
target(store).valueMap.set(key, future);
|
|
910
910
|
future.then((value2) => {
|
|
911
|
+
if (future.isCanceled) {
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
911
914
|
cacheValue(key, value2, subject, store);
|
|
912
915
|
subject.next({ newValue: value2, oldValue: value2 });
|
|
913
916
|
}).catch((error) => {
|
|
@@ -923,6 +926,16 @@ var cacheValue = (key, value, subject, store = IMPLICIT.STORE) => {
|
|
|
923
926
|
};
|
|
924
927
|
var readCachedValue = (key, store = IMPLICIT.STORE) => target(store).valueMap.get(key);
|
|
925
928
|
var isValueCached = (key, store = IMPLICIT.STORE) => target(store).valueMap.has(key);
|
|
929
|
+
var evictCachedValue = (key, store = IMPLICIT.STORE) => {
|
|
930
|
+
var _a;
|
|
931
|
+
const core = target(store);
|
|
932
|
+
const currentValue = core.valueMap.get(key);
|
|
933
|
+
if (currentValue instanceof Future) {
|
|
934
|
+
currentValue.cancel();
|
|
935
|
+
}
|
|
936
|
+
core.valueMap.delete(key);
|
|
937
|
+
(_a = store.config.logger) == null ? void 0 : _a.info(` xx evicted "${key}"`);
|
|
938
|
+
};
|
|
926
939
|
var Tracker = class {
|
|
927
940
|
constructor(mutableState, store = IMPLICIT.STORE) {
|
|
928
941
|
this.unsubscribeFromInnerValue = null;
|
|
@@ -1252,7 +1265,7 @@ var emitUpdate = (state, update, store) => {
|
|
|
1252
1265
|
|
|
1253
1266
|
// src/set-state/evict-downstream.ts
|
|
1254
1267
|
var evictDownStream = (state, store = IMPLICIT.STORE) => {
|
|
1255
|
-
var _a, _b, _c, _d, _e, _f
|
|
1268
|
+
var _a, _b, _c, _d, _e, _f;
|
|
1256
1269
|
const core = target(store);
|
|
1257
1270
|
const downstreamKeys = core.selectorAtoms.getRelatedKeys(state.key);
|
|
1258
1271
|
(_b = store.config.logger) == null ? void 0 : _b.info(
|
|
@@ -1275,8 +1288,7 @@ var evictDownStream = (state, store = IMPLICIT.STORE) => {
|
|
|
1275
1288
|
);
|
|
1276
1289
|
return;
|
|
1277
1290
|
}
|
|
1278
|
-
|
|
1279
|
-
(_g = store.config.logger) == null ? void 0 : _g.info(` xx evicted "${key}"`);
|
|
1291
|
+
evictCachedValue(key, store);
|
|
1280
1292
|
markDone(key, store);
|
|
1281
1293
|
}
|
|
1282
1294
|
}
|
|
@@ -1822,6 +1834,6 @@ var subscribeToRootAtoms = (state, store) => {
|
|
|
1822
1834
|
return dependencySubscriptions;
|
|
1823
1835
|
};
|
|
1824
1836
|
|
|
1825
|
-
export { FamilyTracker, Future, IMPLICIT, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, getJsonToken, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomMutable, isAtomTokenMutable, isDone, isSelectorDefault, isTransceiver, isValueCached, lookup, lookupSelectorSources, markAtomAsDefault, markAtomAsNotDefault, markDone, openOperation, readCachedValue, redoTransactionUpdate, redo__INTERNAL, registerSelector, setState__INTERNAL, subscribeToRootAtoms, target, timeline__INTERNAL, traceAllSelectorAtoms, traceSelectorAtoms, transaction__INTERNAL, undoTransactionUpdate, undo__INTERNAL, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
|
|
1837
|
+
export { FamilyTracker, Future, IMPLICIT, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, addAtomToTimeline, applyTransaction, become, buildTransaction, cacheValue, clearStore, closeOperation, createAtom, createAtomFamily, createMutableAtom, createMutableAtomFamily, createReadonlySelectorFamily, createSelector, createSelectorFamily, deleteAtom, deposit, evictCachedValue, getJsonToken, getState__INTERNAL, getUpdateToken, isAtomDefault, isAtomMutable, isAtomTokenMutable, isDone, isSelectorDefault, isTransceiver, isValueCached, lookup, lookupSelectorSources, markAtomAsDefault, markAtomAsNotDefault, markDone, openOperation, readCachedValue, redoTransactionUpdate, redo__INTERNAL, registerSelector, setState__INTERNAL, subscribeToRootAtoms, target, timeline__INTERNAL, traceAllSelectorAtoms, traceSelectorAtoms, transaction__INTERNAL, undoTransactionUpdate, undo__INTERNAL, updateSelectorAtoms, withdraw, withdrawNewFamilyMember };
|
|
1826
1838
|
//# sourceMappingURL=out.js.map
|
|
1827
1839
|
//# sourceMappingURL=index.mjs.map
|