atom.io 0.12.0 → 0.12.1
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/internal/dist/index.cjs +39 -7
- package/internal/dist/index.cjs.map +1 -1
- package/internal/dist/index.d.cts +12 -2
- package/internal/dist/index.d.ts +12 -2
- package/internal/dist/index.js +39 -8
- package/internal/dist/index.js.map +1 -1
- package/internal/dist/metafile-cjs.json +1 -1
- package/internal/dist/metafile-esm.json +1 -1
- package/internal/src/index.ts +3 -2
- package/internal/src/lazy-map.ts +33 -0
- package/internal/src/transaction/build-transaction.ts +8 -7
- package/package.json +1 -1
package/internal/dist/index.cjs
CHANGED
|
@@ -911,6 +911,37 @@ var applyTransaction = (output, store) => {
|
|
|
911
911
|
store.transactionStatus = { phase: `idle` };
|
|
912
912
|
};
|
|
913
913
|
|
|
914
|
+
// src/lazy-map.ts
|
|
915
|
+
var LazyMap = class extends Map {
|
|
916
|
+
constructor(source) {
|
|
917
|
+
super();
|
|
918
|
+
this.source = source;
|
|
919
|
+
this.deleted = /* @__PURE__ */ new Set();
|
|
920
|
+
}
|
|
921
|
+
get(key) {
|
|
922
|
+
const has = super.has(key);
|
|
923
|
+
if (has) {
|
|
924
|
+
return super.get(key);
|
|
925
|
+
}
|
|
926
|
+
if (!this.deleted.has(key) && this.source.has(key)) {
|
|
927
|
+
const value = this.source.get(key);
|
|
928
|
+
super.set(key, value);
|
|
929
|
+
return value;
|
|
930
|
+
}
|
|
931
|
+
return void 0;
|
|
932
|
+
}
|
|
933
|
+
_has(key) {
|
|
934
|
+
return super.has(key);
|
|
935
|
+
}
|
|
936
|
+
has(key) {
|
|
937
|
+
return !this.deleted.has(key) && (super.has(key) || this.source.has(key));
|
|
938
|
+
}
|
|
939
|
+
delete(key) {
|
|
940
|
+
this.deleted.add(key);
|
|
941
|
+
return super.delete(key);
|
|
942
|
+
}
|
|
943
|
+
};
|
|
944
|
+
|
|
914
945
|
// src/transaction/build-transaction.ts
|
|
915
946
|
var buildTransaction = (key, params, store) => {
|
|
916
947
|
store.transactionStatus = {
|
|
@@ -918,21 +949,21 @@ var buildTransaction = (key, params, store) => {
|
|
|
918
949
|
phase: `building`,
|
|
919
950
|
time: Date.now(),
|
|
920
951
|
core: {
|
|
921
|
-
atoms: new
|
|
952
|
+
atoms: new LazyMap(store.atoms),
|
|
922
953
|
atomsThatAreDefault: new Set(store.atomsThatAreDefault),
|
|
923
|
-
families: new
|
|
954
|
+
families: new LazyMap(store.families),
|
|
924
955
|
operation: { open: false },
|
|
925
|
-
readonlySelectors: new
|
|
926
|
-
timelines: new
|
|
956
|
+
readonlySelectors: new LazyMap(store.readonlySelectors),
|
|
957
|
+
timelines: new LazyMap(store.timelines),
|
|
927
958
|
timelineAtoms: new Junction(store.timelineAtoms.toJSON()),
|
|
928
959
|
trackers: /* @__PURE__ */ new Map(),
|
|
929
|
-
transactions: new
|
|
960
|
+
transactions: new LazyMap(store.transactions),
|
|
930
961
|
selectorAtoms: new Junction(store.selectorAtoms.toJSON()),
|
|
931
962
|
selectorGraph: new Junction(store.selectorGraph.toJSON(), {
|
|
932
963
|
makeContentKey: (...keys) => keys.sort().join(`:`)
|
|
933
964
|
}),
|
|
934
|
-
selectors: new
|
|
935
|
-
valueMap: new
|
|
965
|
+
selectors: new LazyMap(store.selectors),
|
|
966
|
+
valueMap: new LazyMap(store.valueMap)
|
|
936
967
|
},
|
|
937
968
|
atomUpdates: [],
|
|
938
969
|
params,
|
|
@@ -2095,6 +2126,7 @@ var subscribeToRootAtoms = (state, store) => {
|
|
|
2095
2126
|
exports.FamilyTracker = FamilyTracker;
|
|
2096
2127
|
exports.Future = Future;
|
|
2097
2128
|
exports.IMPLICIT = IMPLICIT;
|
|
2129
|
+
exports.LazyMap = LazyMap;
|
|
2098
2130
|
exports.NotFoundError = NotFoundError;
|
|
2099
2131
|
exports.Store = Store;
|
|
2100
2132
|
exports.Subject = Subject;
|