atom.io 0.9.3 → 0.9.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.
@@ -923,6 +923,16 @@ var cacheValue = (key, value, subject, store = IMPLICIT.STORE) => {
923
923
  };
924
924
  var readCachedValue = (key, store = IMPLICIT.STORE) => target(store).valueMap.get(key);
925
925
  var isValueCached = (key, store = IMPLICIT.STORE) => target(store).valueMap.has(key);
926
+ var evictCachedValue = (key, store = IMPLICIT.STORE) => {
927
+ var _a;
928
+ const core = target(store);
929
+ const currentValue = core.valueMap.get(key);
930
+ if (currentValue instanceof Future) {
931
+ currentValue.cancel();
932
+ }
933
+ core.valueMap.delete(key);
934
+ (_a = store.config.logger) == null ? void 0 : _a.info(` xx evicted "${key}"`);
935
+ };
926
936
  var Tracker = class {
927
937
  constructor(mutableState, store = IMPLICIT.STORE) {
928
938
  this.unsubscribeFromInnerValue = null;
@@ -1252,7 +1262,7 @@ var emitUpdate = (state, update, store) => {
1252
1262
 
1253
1263
  // src/set-state/evict-downstream.ts
1254
1264
  var evictDownStream = (state, store = IMPLICIT.STORE) => {
1255
- var _a, _b, _c, _d, _e, _f, _g;
1265
+ var _a, _b, _c, _d, _e, _f;
1256
1266
  const core = target(store);
1257
1267
  const downstreamKeys = core.selectorAtoms.getRelatedKeys(state.key);
1258
1268
  (_b = store.config.logger) == null ? void 0 : _b.info(
@@ -1275,8 +1285,7 @@ var evictDownStream = (state, store = IMPLICIT.STORE) => {
1275
1285
  );
1276
1286
  return;
1277
1287
  }
1278
- core.valueMap.delete(key);
1279
- (_g = store.config.logger) == null ? void 0 : _g.info(` xx evicted "${key}"`);
1288
+ evictCachedValue(key, store);
1280
1289
  markDone(key, store);
1281
1290
  }
1282
1291
  }
@@ -1822,6 +1831,6 @@ var subscribeToRootAtoms = (state, store) => {
1822
1831
  return dependencySubscriptions;
1823
1832
  };
1824
1833
 
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 };
1834
+ 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
1835
  //# sourceMappingURL=out.js.map
1827
1836
  //# sourceMappingURL=index.mjs.map