atom.io 0.38.2 → 0.39.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/dist/data/index.js.map +1 -1
- package/dist/eslint-plugin/index.js +2 -1
- package/dist/eslint-plugin/index.js.map +1 -1
- package/dist/internal/index.d.ts +128 -85
- package/dist/internal/index.d.ts.map +1 -1
- package/dist/internal/index.js +429 -286
- package/dist/internal/index.js.map +1 -1
- package/dist/introspection/index.d.ts.map +1 -1
- package/dist/introspection/index.js.map +1 -1
- package/dist/json/index.d.ts.map +1 -1
- package/dist/json/index.js.map +1 -1
- package/dist/main/index.d.ts +45 -35
- package/dist/main/index.d.ts.map +1 -1
- package/dist/main/index.js.map +1 -1
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +43 -2
- package/dist/react/index.js.map +1 -1
- package/dist/react-devtools/index.d.ts.map +1 -1
- package/dist/react-devtools/index.js +4 -5
- package/dist/react-devtools/index.js.map +1 -1
- package/dist/realtime/index.d.ts.map +1 -1
- package/dist/realtime/index.js.map +1 -1
- package/dist/realtime-client/index.js +5 -5
- package/dist/realtime-client/index.js.map +1 -1
- package/dist/realtime-react/index.js.map +1 -1
- package/dist/realtime-server/index.d.ts.map +1 -1
- package/dist/realtime-server/index.js +4 -4
- package/dist/realtime-server/index.js.map +1 -1
- package/dist/realtime-testing/index.d.ts.map +1 -1
- package/dist/realtime-testing/index.js.map +1 -1
- package/dist/transceivers/set-rtx/index.d.ts.map +1 -1
- package/dist/transceivers/set-rtx/index.js.map +1 -1
- package/dist/web/index.js.map +1 -1
- package/package.json +10 -11
- package/src/internal/atom/create-regular-atom.ts +2 -6
- package/src/internal/caching.ts +2 -4
- package/src/internal/{ingest-updates → events}/ingest-atom-update.ts +4 -5
- package/src/internal/{ingest-updates → events}/ingest-creation-disposal.ts +37 -37
- package/src/internal/{ingest-updates → events}/ingest-selector-update.ts +5 -5
- package/src/internal/events/ingest-transaction-update.ts +45 -0
- package/src/internal/families/create-readonly-held-selector-family.ts +1 -1
- package/src/internal/families/create-readonly-pure-selector-family.ts +1 -1
- package/src/internal/families/create-regular-atom-family.ts +4 -3
- package/src/internal/families/create-writable-held-selector-family.ts +1 -1
- package/src/internal/families/create-writable-pure-selector-family.ts +1 -1
- package/src/internal/families/find-in-store.ts +2 -2
- package/src/internal/families/get-family-of-token.ts +1 -0
- package/src/internal/families/index.ts +0 -1
- package/src/internal/families/mint-in-store.ts +30 -64
- package/src/internal/get-state/get-from-store.ts +2 -3
- package/src/internal/get-state/read-or-compute-value.ts +6 -15
- package/src/internal/get-state/reduce-reference.ts +52 -11
- package/src/internal/index.ts +2 -2
- package/src/internal/is-fn.ts +9 -0
- package/src/internal/junction.ts +177 -133
- package/src/internal/mutable/create-mutable-atom-family.ts +1 -1
- package/src/internal/overlays/index.ts +3 -0
- package/src/internal/overlays/map-overlay.ts +86 -0
- package/src/internal/{lazy-map.ts → overlays/relations-overlay.ts} +6 -6
- package/src/internal/overlays/set-overlay.ts +55 -0
- package/src/internal/selector/create-readonly-held-selector.ts +8 -11
- package/src/internal/selector/create-readonly-pure-selector.ts +8 -10
- package/src/internal/selector/create-writable-held-selector.ts +6 -6
- package/src/internal/selector/create-writable-pure-selector.ts +2 -2
- package/src/internal/selector/register-selector.ts +3 -4
- package/src/internal/set-state/become.ts +11 -6
- package/src/internal/set-state/dispatch-state-update.ts +47 -12
- package/src/internal/set-state/operate-on-store.ts +10 -8
- package/src/internal/set-state/reset-atom-or-selector.ts +7 -7
- package/src/internal/set-state/set-atom-or-selector.ts +3 -2
- package/src/internal/set-state/set-atom.ts +5 -4
- package/src/internal/set-state/set-selector.ts +9 -8
- package/src/internal/store/withdraw.ts +4 -4
- package/src/internal/timeline/time-travel.ts +11 -11
- package/src/internal/transaction/apply-transaction.ts +5 -5
- package/src/internal/transaction/build-transaction.ts +17 -26
- package/src/internal/transaction/create-transaction.ts +1 -1
- package/src/internal/transaction/is-root-store.ts +2 -2
- package/src/main/events.ts +14 -3
- package/src/main/logger.ts +43 -32
- package/src/react-devtools/json-editor/editors-by-type/array-editor.tsx +1 -1
- package/src/react-devtools/json-editor/editors-by-type/object-editor.tsx +2 -3
- package/src/react-devtools/json-editor/editors-by-type/utilities/array-elements.ts +1 -1
- package/src/react-devtools/json-editor/editors-by-type/utilities/object-properties.ts +1 -1
- package/src/realtime-client/continuity/register-and-attempt-confirmed-update.ts +5 -5
- package/src/realtime-server/continuity/subscribe-to-continuity-perpectives.ts +4 -4
- package/dist/use-o-DXPncKmZ.js +0 -47
- package/dist/use-o-DXPncKmZ.js.map +0 -1
- package/src/internal/families/init-family-member.ts +0 -33
- package/src/internal/ingest-updates/ingest-transaction-update.ts +0 -47
- /package/src/internal/{ingest-updates → events}/index.ts +0 -0
package/dist/internal/index.js
CHANGED
|
@@ -81,9 +81,151 @@ function mint(token, key, counterfeit) {
|
|
|
81
81
|
return stateToken;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region src/internal/overlays/map-overlay.ts
|
|
86
|
+
var MapOverlay = class extends Map {
|
|
87
|
+
deleted = /* @__PURE__ */ new Set();
|
|
88
|
+
changed = /* @__PURE__ */ new Set();
|
|
89
|
+
source;
|
|
90
|
+
constructor(source) {
|
|
91
|
+
super();
|
|
92
|
+
this.source = source;
|
|
93
|
+
}
|
|
94
|
+
get(key) {
|
|
95
|
+
const has = super.has(key);
|
|
96
|
+
if (has) return super.get(key);
|
|
97
|
+
if (!this.deleted.has(key) && this.source.has(key)) {
|
|
98
|
+
const value = this.source.get(key);
|
|
99
|
+
return value;
|
|
100
|
+
}
|
|
101
|
+
return void 0;
|
|
102
|
+
}
|
|
103
|
+
set(key, value) {
|
|
104
|
+
this.deleted.delete(key);
|
|
105
|
+
if (this.source.has(key)) this.changed.add(key);
|
|
106
|
+
return super.set(key, value);
|
|
107
|
+
}
|
|
108
|
+
hasOwn(key) {
|
|
109
|
+
return super.has(key);
|
|
110
|
+
}
|
|
111
|
+
has(key) {
|
|
112
|
+
return !this.deleted.has(key) && (super.has(key) || this.source.has(key));
|
|
113
|
+
}
|
|
114
|
+
delete(key) {
|
|
115
|
+
if (this.source.has(key)) {
|
|
116
|
+
this.deleted.add(key);
|
|
117
|
+
this.changed.delete(key);
|
|
118
|
+
}
|
|
119
|
+
return super.delete(key);
|
|
120
|
+
}
|
|
121
|
+
clear() {
|
|
122
|
+
this.deleted = new Set(this.source.keys());
|
|
123
|
+
this.changed.clear();
|
|
124
|
+
super.clear();
|
|
125
|
+
}
|
|
126
|
+
*[Symbol.iterator]() {
|
|
127
|
+
yield* super[Symbol.iterator]();
|
|
128
|
+
for (const [key, value] of this.source) if (!this.deleted.has(key) && !this.changed.has(key)) yield [key, value];
|
|
129
|
+
}
|
|
130
|
+
*entries() {
|
|
131
|
+
yield* this[Symbol.iterator]();
|
|
132
|
+
}
|
|
133
|
+
*keys() {
|
|
134
|
+
yield* super.keys();
|
|
135
|
+
for (const key of this.source.keys()) if (!this.deleted.has(key) && !this.changed.has(key)) yield key;
|
|
136
|
+
}
|
|
137
|
+
*values() {
|
|
138
|
+
for (const [, value] of this[Symbol.iterator]()) yield value;
|
|
139
|
+
}
|
|
140
|
+
forEach(callbackfn) {
|
|
141
|
+
for (const [key, value] of this[Symbol.iterator]()) callbackfn(value, key, this);
|
|
142
|
+
}
|
|
143
|
+
get size() {
|
|
144
|
+
return super.size + this.source.size - this.changed.size - this.deleted.size;
|
|
145
|
+
}
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/internal/overlays/set-overlay.ts
|
|
150
|
+
var SetOverlay = class extends Set {
|
|
151
|
+
deleted = /* @__PURE__ */ new Set();
|
|
152
|
+
source;
|
|
153
|
+
constructor(source) {
|
|
154
|
+
super();
|
|
155
|
+
this.source = source;
|
|
156
|
+
}
|
|
157
|
+
add(value) {
|
|
158
|
+
if (this.source.has(value)) {
|
|
159
|
+
this.deleted.delete(value);
|
|
160
|
+
return this;
|
|
161
|
+
}
|
|
162
|
+
return super.add(value);
|
|
163
|
+
}
|
|
164
|
+
hasOwn(member) {
|
|
165
|
+
return super.has(member);
|
|
166
|
+
}
|
|
167
|
+
has(key) {
|
|
168
|
+
return !this.deleted.has(key) && (super.has(key) || this.source.has(key));
|
|
169
|
+
}
|
|
170
|
+
delete(key) {
|
|
171
|
+
if (this.source.has(key)) {
|
|
172
|
+
this.deleted.add(key);
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
return super.delete(key);
|
|
176
|
+
}
|
|
177
|
+
clear() {
|
|
178
|
+
this.deleted = new Set(this.source);
|
|
179
|
+
super.clear();
|
|
180
|
+
}
|
|
181
|
+
*[Symbol.iterator]() {
|
|
182
|
+
yield* super[Symbol.iterator]();
|
|
183
|
+
for (const value of this.source) if (!this.deleted.has(value)) yield value;
|
|
184
|
+
}
|
|
185
|
+
*iterateOwn() {
|
|
186
|
+
yield* super[Symbol.iterator]();
|
|
187
|
+
}
|
|
188
|
+
get size() {
|
|
189
|
+
return super.size + this.source.size - this.deleted.size;
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
//#endregion
|
|
194
|
+
//#region src/internal/overlays/relations-overlay.ts
|
|
195
|
+
var RelationsOverlay = class extends Map {
|
|
196
|
+
deleted = /* @__PURE__ */ new Set();
|
|
197
|
+
source;
|
|
198
|
+
constructor(source) {
|
|
199
|
+
super();
|
|
200
|
+
this.source = source;
|
|
201
|
+
}
|
|
202
|
+
get(key) {
|
|
203
|
+
const has = super.has(key);
|
|
204
|
+
if (has) return super.get(key);
|
|
205
|
+
if (!this.deleted.has(key) && this.source.has(key)) {
|
|
206
|
+
const value = this.source.get(key);
|
|
207
|
+
const valueOverlay = new SetOverlay(value);
|
|
208
|
+
super.set(key, valueOverlay);
|
|
209
|
+
return valueOverlay;
|
|
210
|
+
}
|
|
211
|
+
return void 0;
|
|
212
|
+
}
|
|
213
|
+
set(key, value) {
|
|
214
|
+
this.deleted.delete(key);
|
|
215
|
+
return super.set(key, value);
|
|
216
|
+
}
|
|
217
|
+
has(key) {
|
|
218
|
+
return !this.deleted.has(key) && (super.has(key) || this.source.has(key));
|
|
219
|
+
}
|
|
220
|
+
delete(key) {
|
|
221
|
+
this.deleted.add(key);
|
|
222
|
+
return super.delete(key);
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
|
|
84
226
|
//#endregion
|
|
85
227
|
//#region src/internal/junction.ts
|
|
86
|
-
var Junction = class {
|
|
228
|
+
var Junction = class Junction {
|
|
87
229
|
a;
|
|
88
230
|
b;
|
|
89
231
|
cardinality;
|
|
@@ -167,14 +309,21 @@ var Junction = class {
|
|
|
167
309
|
this.a = data.between[0];
|
|
168
310
|
this.b = data.between[1];
|
|
169
311
|
this.cardinality = data.cardinality;
|
|
170
|
-
if (!config?.externalStore) {
|
|
171
|
-
this.relations = new Map(data.relations?.map(([x, ys]) => [x, new Set(ys)]));
|
|
172
|
-
this.contents = new Map(data.contents);
|
|
173
|
-
}
|
|
174
312
|
this.isAType = config?.isAType ?? null;
|
|
175
313
|
this.isBType = config?.isBType ?? null;
|
|
176
314
|
this.isContent = config?.isContent ?? null;
|
|
177
315
|
if (config?.makeContentKey) this.makeContentKey = config.makeContentKey;
|
|
316
|
+
if (!config?.externalStore) {
|
|
317
|
+
const source = config?.source;
|
|
318
|
+
if (source === void 0) {
|
|
319
|
+
this.relations = new Map(data.relations?.map(([x, ys]) => [x, new Set(ys)]));
|
|
320
|
+
this.contents = new Map(data.contents);
|
|
321
|
+
}
|
|
322
|
+
if (source) {
|
|
323
|
+
this.relations = new RelationsOverlay(source.relations);
|
|
324
|
+
this.contents = new MapOverlay(source.contents);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
178
327
|
if (config?.externalStore) {
|
|
179
328
|
const externalStore = config.externalStore;
|
|
180
329
|
this.has = (a, b) => externalStore.has(a, b);
|
|
@@ -277,12 +426,10 @@ var Junction = class {
|
|
|
277
426
|
if (a === void 0 && typeof b === `string`) {
|
|
278
427
|
const bRelations = this.getRelatedKeys(b);
|
|
279
428
|
if (bRelations) for (const bRelation of bRelations) this.delete(bRelation, b);
|
|
280
|
-
}
|
|
281
|
-
if (typeof a === `string` && b === void 0) {
|
|
429
|
+
} else if (typeof a === `string` && b === void 0) {
|
|
282
430
|
const aRelations = this.getRelatedKeys(a);
|
|
283
431
|
if (aRelations) for (const aRelation of aRelations) this.delete(a, aRelation);
|
|
284
|
-
}
|
|
285
|
-
if (typeof a === `string` && typeof b === `string`) {
|
|
432
|
+
} else if (typeof a === `string` && typeof b === `string`) {
|
|
286
433
|
this.deleteRelation(a, b);
|
|
287
434
|
const contentKey = this.makeContentKey(a, b);
|
|
288
435
|
this.deleteContent(contentKey);
|
|
@@ -341,6 +488,30 @@ var Junction = class {
|
|
|
341
488
|
}
|
|
342
489
|
return this.relations.has(a);
|
|
343
490
|
}
|
|
491
|
+
overlay() {
|
|
492
|
+
const config = {
|
|
493
|
+
source: this,
|
|
494
|
+
makeContentKey: this.makeContentKey
|
|
495
|
+
};
|
|
496
|
+
if (this.isAType) config.isAType = this.isAType;
|
|
497
|
+
if (this.isBType) config.isBType = this.isBType;
|
|
498
|
+
if (this.isContent) config.isContent = this.isContent;
|
|
499
|
+
if (this.warn) config.warn = this.warn;
|
|
500
|
+
return new Junction({
|
|
501
|
+
between: [this.a, this.b],
|
|
502
|
+
cardinality: this.cardinality
|
|
503
|
+
}, config);
|
|
504
|
+
}
|
|
505
|
+
incorporate(overlay) {
|
|
506
|
+
const { relations, contents } = overlay;
|
|
507
|
+
for (const [key, value] of relations) if (value instanceof SetOverlay) {
|
|
508
|
+
const { source } = value;
|
|
509
|
+
for (const keyAdded of value.iterateOwn()) source.add(keyAdded);
|
|
510
|
+
} else this.relations.set(key, value);
|
|
511
|
+
for (const key of relations.deleted) this.relations.delete(key);
|
|
512
|
+
for (const [key, value] of contents) this.contents.set(key, value);
|
|
513
|
+
for (const key of contents.deleted) this.contents.delete(key);
|
|
514
|
+
}
|
|
344
515
|
};
|
|
345
516
|
|
|
346
517
|
//#endregion
|
|
@@ -587,6 +758,7 @@ function writeToCache(target, state, value) {
|
|
|
587
758
|
});
|
|
588
759
|
return future;
|
|
589
760
|
}
|
|
761
|
+
target.logger.info(`📝`, state.type, state.key, `writing to cache`, value);
|
|
590
762
|
target.valueMap.set(key, value);
|
|
591
763
|
return value;
|
|
592
764
|
}
|
|
@@ -626,10 +798,19 @@ function evictCachedValue(target, key) {
|
|
|
626
798
|
target.logger.info(`🗑`, `state`, key, `evicted`);
|
|
627
799
|
}
|
|
628
800
|
|
|
801
|
+
//#endregion
|
|
802
|
+
//#region src/internal/is-fn.ts
|
|
803
|
+
const NON_CTOR_FN_REGEX = /^\[object (?:Async|Generator|AsyncGenerator)?Function\]$/;
|
|
804
|
+
function isFn(input) {
|
|
805
|
+
const protoString = Object.prototype.toString.call(input);
|
|
806
|
+
return NON_CTOR_FN_REGEX.test(protoString);
|
|
807
|
+
}
|
|
808
|
+
|
|
629
809
|
//#endregion
|
|
630
810
|
//#region src/internal/get-state/read-or-compute-value.ts
|
|
631
811
|
function readOrComputeValue(target, state, mut) {
|
|
632
812
|
if (target.valueMap.has(state.key)) return readFromCache(target, state, mut);
|
|
813
|
+
target.logger.info(`❔`, state.type, state.key, `value not found in cache`);
|
|
633
814
|
const { key } = state;
|
|
634
815
|
switch (state.type) {
|
|
635
816
|
case `readonly_held_selector`:
|
|
@@ -640,16 +821,20 @@ function readOrComputeValue(target, state, mut) {
|
|
|
640
821
|
return state.getFrom(target);
|
|
641
822
|
case `atom`: {
|
|
642
823
|
let def;
|
|
643
|
-
if (state.default
|
|
644
|
-
|
|
824
|
+
if (isFn(state.default)) {
|
|
825
|
+
def = state.default();
|
|
826
|
+
target.logger.info(`✨`, state.type, key, `computed default`, def);
|
|
827
|
+
} else {
|
|
828
|
+
def = state.default;
|
|
829
|
+
target.logger.info(`✨`, state.type, key, `using static default`, def);
|
|
830
|
+
}
|
|
645
831
|
const cachedValue = writeToCache(target, state, def);
|
|
646
|
-
target.logger.info(`💁`, `atom`, state.key, `could not find cached value; using default`, def);
|
|
647
832
|
return cachedValue;
|
|
648
833
|
}
|
|
649
834
|
case `mutable_atom`: {
|
|
650
835
|
const instance = new state.class();
|
|
836
|
+
target.logger.info(`✨`, state.type, key, `created new instance`, instance);
|
|
651
837
|
const cachedValue = writeToCache(target, state, instance);
|
|
652
|
-
target.logger.info(`💁`, `mutable_atom`, state.key, `could not find cached value; using default`, instance);
|
|
653
838
|
return cachedValue;
|
|
654
839
|
}
|
|
655
840
|
}
|
|
@@ -664,6 +849,26 @@ function getFamilyOfToken(store, token) {
|
|
|
664
849
|
});
|
|
665
850
|
}
|
|
666
851
|
|
|
852
|
+
//#endregion
|
|
853
|
+
//#region src/internal/families/mint-in-store.ts
|
|
854
|
+
const MUST_CREATE = Symbol(`MUST_CREATE`);
|
|
855
|
+
function mintInStore(store, family, key, mustCreate) {
|
|
856
|
+
const stringKey = stringifyJson(key);
|
|
857
|
+
const molecule = store.molecules.get(stringKey);
|
|
858
|
+
const cannotCreate = !molecule && store.config.lifespan === `immortal`;
|
|
859
|
+
if (cannotCreate) {
|
|
860
|
+
store.logger.warn(`💣`, `key`, stringKey, `was used to mint a counterfeit token for`, family.type, `"${family.key}"`);
|
|
861
|
+
return mint(family, key, COUNTERFEIT);
|
|
862
|
+
}
|
|
863
|
+
let token;
|
|
864
|
+
if (mustCreate === MUST_CREATE) {
|
|
865
|
+
store.logger.info(`👪`, family.type, family.key, `adds member`, typeof key === `string` ? `\`${key}\`` : key);
|
|
866
|
+
token = family(key);
|
|
867
|
+
if (molecule) store.moleculeData.set(stringKey, family.key);
|
|
868
|
+
} else token = mint(family, key);
|
|
869
|
+
return token;
|
|
870
|
+
}
|
|
871
|
+
|
|
667
872
|
//#endregion
|
|
668
873
|
//#region src/internal/transaction/abort-transaction.ts
|
|
669
874
|
const abortTransaction = (store) => {
|
|
@@ -696,62 +901,24 @@ function actUponStore(store, token, id) {
|
|
|
696
901
|
|
|
697
902
|
//#endregion
|
|
698
903
|
//#region src/internal/set-state/become.ts
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
//#region src/internal/set-state/dispatch-state-update.ts
|
|
703
|
-
function dispatchOrDeferStateUpdate(target, state, [oldValue, newValue], _stateIsNewlyCreated) {
|
|
704
|
-
const { key, subject, type } = state;
|
|
705
|
-
const update = {
|
|
706
|
-
oldValue: isTransceiver(oldValue) ? oldValue.READONLY_VIEW : oldValue,
|
|
707
|
-
newValue: isTransceiver(newValue) ? newValue.READONLY_VIEW : newValue
|
|
708
|
-
};
|
|
709
|
-
if (isRootStore(target)) {
|
|
710
|
-
switch (type) {
|
|
711
|
-
case `mutable_atom`:
|
|
712
|
-
target.logger.info(`📢`, type, key, `is now (`, newValue, `) subscribers:`, subject.subscribers);
|
|
713
|
-
break;
|
|
714
|
-
case `atom`:
|
|
715
|
-
case `writable_pure_selector`:
|
|
716
|
-
case `writable_held_selector`: target.logger.info(`📢`, type, key, `went (`, oldValue, `->`, newValue, `) subscribers:`, subject.subscribers);
|
|
717
|
-
}
|
|
718
|
-
subject.next(update);
|
|
719
|
-
}
|
|
720
|
-
if (isChildStore(target) && (type === `mutable_atom` || type === `atom`)) {
|
|
721
|
-
if (target.on.transactionApplying.state === null) {
|
|
722
|
-
const token = deposit(state);
|
|
723
|
-
if (isTransceiver(newValue)) return;
|
|
724
|
-
const { timestamp } = target.operation;
|
|
725
|
-
const atomUpdate = {
|
|
726
|
-
type: `atom_update`,
|
|
727
|
-
token,
|
|
728
|
-
timestamp,
|
|
729
|
-
update
|
|
730
|
-
};
|
|
731
|
-
target.transactionMeta.update.subEvents.push(atomUpdate);
|
|
732
|
-
target.logger.info(`📁`, `atom`, key, `stowed (`, oldValue, `->`, newValue, `)`);
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
if (hasRole(state, `tracker:signal`)) {
|
|
736
|
-
const keyOfMutable = key.slice(1);
|
|
737
|
-
const mutable = target.atoms.get(keyOfMutable);
|
|
738
|
-
const transceiver = readOrComputeValue(target, mutable, `mut`);
|
|
739
|
-
const accepted = transceiver.do(update.newValue) === null;
|
|
740
|
-
if (accepted === true) evictDownstreamFromAtom(target, mutable);
|
|
741
|
-
}
|
|
742
|
-
}
|
|
904
|
+
function become(nextVersionOfThing, originalThing) {
|
|
905
|
+
if (isFn(nextVersionOfThing)) return nextVersionOfThing(originalThing);
|
|
906
|
+
return nextVersionOfThing;
|
|
743
907
|
}
|
|
744
908
|
|
|
745
909
|
//#endregion
|
|
746
910
|
//#region src/internal/set-state/set-atom.ts
|
|
747
911
|
const setAtom = (target, atom, next) => {
|
|
748
912
|
const oldValue = readOrComputeValue(target, atom, `mut`);
|
|
749
|
-
let newValue = become(next
|
|
750
|
-
target.logger.info(
|
|
913
|
+
let newValue = become(next, oldValue);
|
|
914
|
+
target.logger.info(`⭐`, `atom`, atom.key, `setting value`, newValue);
|
|
751
915
|
newValue = writeToCache(target, atom, newValue);
|
|
752
916
|
markDone(target, atom.key);
|
|
753
917
|
evictDownstreamFromAtom(target, atom);
|
|
754
|
-
return
|
|
918
|
+
return {
|
|
919
|
+
oldValue,
|
|
920
|
+
newValue
|
|
921
|
+
};
|
|
755
922
|
};
|
|
756
923
|
|
|
757
924
|
//#endregion
|
|
@@ -761,7 +928,7 @@ function resetAtom(target, atom) {
|
|
|
761
928
|
case `mutable_atom`: return setAtom(target, atom, new atom.class());
|
|
762
929
|
case `atom`: {
|
|
763
930
|
let def = atom.default;
|
|
764
|
-
if (def
|
|
931
|
+
if (isFn(def)) def = def();
|
|
765
932
|
return setAtom(target, atom, def);
|
|
766
933
|
}
|
|
767
934
|
}
|
|
@@ -783,7 +950,10 @@ function resetAtomOrSelector(target, state) {
|
|
|
783
950
|
dispatchOrDeferStateUpdate(target, state, rootProtoUpdate, false);
|
|
784
951
|
}
|
|
785
952
|
const newValue = state.getFrom(target);
|
|
786
|
-
protoUpdate =
|
|
953
|
+
protoUpdate = {
|
|
954
|
+
oldValue,
|
|
955
|
+
newValue
|
|
956
|
+
};
|
|
787
957
|
}
|
|
788
958
|
break;
|
|
789
959
|
}
|
|
@@ -822,20 +992,23 @@ function setSelector(target, selector, next) {
|
|
|
822
992
|
const { type, key } = selector;
|
|
823
993
|
switch (selector.type) {
|
|
824
994
|
case `writable_pure_selector`:
|
|
825
|
-
oldValue =
|
|
826
|
-
newValue = become(next
|
|
827
|
-
writeToCache(target, selector, newValue);
|
|
995
|
+
oldValue = readOrComputeValue(target, selector, `mut`);
|
|
996
|
+
newValue = become(next, oldValue);
|
|
997
|
+
newValue = writeToCache(target, selector, newValue);
|
|
828
998
|
break;
|
|
829
999
|
case `writable_held_selector`:
|
|
830
1000
|
constant = selector.const;
|
|
831
|
-
become(next
|
|
1001
|
+
become(next, constant);
|
|
832
1002
|
oldValue = constant;
|
|
833
1003
|
newValue = constant;
|
|
834
1004
|
}
|
|
835
|
-
target.logger.info(
|
|
1005
|
+
target.logger.info(`⭐`, type, key, `setting to`, newValue);
|
|
836
1006
|
markDone(target, key);
|
|
837
1007
|
selector.setSelf(newValue);
|
|
838
|
-
return
|
|
1008
|
+
return {
|
|
1009
|
+
oldValue,
|
|
1010
|
+
newValue
|
|
1011
|
+
};
|
|
839
1012
|
}
|
|
840
1013
|
|
|
841
1014
|
//#endregion
|
|
@@ -856,9 +1029,9 @@ const setAtomOrSelector = (target, state, value) => {
|
|
|
856
1029
|
};
|
|
857
1030
|
|
|
858
1031
|
//#endregion
|
|
859
|
-
//#region src/internal/
|
|
860
|
-
function
|
|
861
|
-
const { token, update: { newValue, oldValue } } =
|
|
1032
|
+
//#region src/internal/events/ingest-atom-update.ts
|
|
1033
|
+
function ingestAtomUpdateEvent(store, event, applying) {
|
|
1034
|
+
const { token, update: { newValue, oldValue } } = event;
|
|
862
1035
|
const value = applying === `newValue` ? newValue : oldValue;
|
|
863
1036
|
setIntoStore(store, token, value);
|
|
864
1037
|
}
|
|
@@ -1015,59 +1188,57 @@ function claimWithinStore(store, newProvenance, claim, exclusive) {
|
|
|
1015
1188
|
}
|
|
1016
1189
|
|
|
1017
1190
|
//#endregion
|
|
1018
|
-
//#region src/internal/
|
|
1019
|
-
function ingestCreationEvent(
|
|
1191
|
+
//#region src/internal/events/ingest-creation-disposal.ts
|
|
1192
|
+
function ingestCreationEvent(store, event, applying) {
|
|
1020
1193
|
switch (applying) {
|
|
1021
1194
|
case `newValue`:
|
|
1022
|
-
createInStore(
|
|
1195
|
+
createInStore(store, event);
|
|
1023
1196
|
break;
|
|
1024
1197
|
case `oldValue`:
|
|
1025
|
-
disposeFromStore(store,
|
|
1198
|
+
disposeFromStore(store, event.token);
|
|
1026
1199
|
break;
|
|
1027
1200
|
}
|
|
1028
1201
|
}
|
|
1029
|
-
function ingestDisposalEvent(
|
|
1202
|
+
function ingestDisposalEvent(store, event, applying) {
|
|
1030
1203
|
switch (applying) {
|
|
1031
1204
|
case `newValue`:
|
|
1032
|
-
disposeFromStore(store,
|
|
1205
|
+
disposeFromStore(store, event.token);
|
|
1033
1206
|
break;
|
|
1034
1207
|
case `oldValue`:
|
|
1035
|
-
createInStore(
|
|
1036
|
-
if (
|
|
1208
|
+
createInStore(store, event);
|
|
1209
|
+
if (event.subType === `atom`) store.valueMap.set(event.token.key, event.value);
|
|
1037
1210
|
break;
|
|
1038
1211
|
}
|
|
1039
1212
|
}
|
|
1040
|
-
function createInStore(
|
|
1041
|
-
const {
|
|
1042
|
-
if (
|
|
1043
|
-
|
|
1044
|
-
if (family) mintInStore(store, family, parseJson(familyMeta.subKey), MUST_CREATE);
|
|
1045
|
-
}
|
|
1213
|
+
function createInStore(store, event) {
|
|
1214
|
+
const { token } = event;
|
|
1215
|
+
if (event.subType === `writable` && event.value) setIntoStore(store, token, event.value);
|
|
1216
|
+
else getFromStore(store, token);
|
|
1046
1217
|
}
|
|
1047
|
-
function ingestMoleculeCreationEvent(
|
|
1218
|
+
function ingestMoleculeCreationEvent(store, event, applying) {
|
|
1048
1219
|
switch (applying) {
|
|
1049
1220
|
case `newValue`:
|
|
1050
|
-
allocateIntoStore(store,
|
|
1221
|
+
allocateIntoStore(store, event.provenance, event.key);
|
|
1051
1222
|
break;
|
|
1052
1223
|
case `oldValue`:
|
|
1053
|
-
deallocateFromStore(store,
|
|
1224
|
+
deallocateFromStore(store, event.key);
|
|
1054
1225
|
break;
|
|
1055
1226
|
}
|
|
1056
1227
|
}
|
|
1057
|
-
function ingestMoleculeDisposalEvent(
|
|
1228
|
+
function ingestMoleculeDisposalEvent(store, event, applying) {
|
|
1058
1229
|
switch (applying) {
|
|
1059
1230
|
case `newValue`:
|
|
1060
|
-
deallocateFromStore(store,
|
|
1231
|
+
deallocateFromStore(store, event.key);
|
|
1061
1232
|
break;
|
|
1062
1233
|
case `oldValue`:
|
|
1063
1234
|
{
|
|
1064
|
-
const provenanceJson =
|
|
1065
|
-
allocateIntoStore(store, provenanceJson,
|
|
1066
|
-
for (const [familyKey, value] of
|
|
1235
|
+
const provenanceJson = event.provenance.map(parseJson);
|
|
1236
|
+
allocateIntoStore(store, provenanceJson, event.key);
|
|
1237
|
+
for (const [familyKey, value] of event.values) {
|
|
1067
1238
|
const family = store.families.get(familyKey);
|
|
1068
1239
|
if (family) {
|
|
1069
|
-
|
|
1070
|
-
const memberKey = `${familyKey}(${stringifyJson(
|
|
1240
|
+
getFromStore(store, family, event.key);
|
|
1241
|
+
const memberKey = `${familyKey}(${stringifyJson(event.key)})`;
|
|
1071
1242
|
store.valueMap.set(memberKey, value);
|
|
1072
1243
|
}
|
|
1073
1244
|
}
|
|
@@ -1075,16 +1246,16 @@ function ingestMoleculeDisposalEvent(update, applying, store) {
|
|
|
1075
1246
|
break;
|
|
1076
1247
|
}
|
|
1077
1248
|
}
|
|
1078
|
-
function ingestMoleculeTransferEvent(
|
|
1249
|
+
function ingestMoleculeTransferEvent(store, event, applying) {
|
|
1079
1250
|
switch (applying) {
|
|
1080
1251
|
case `newValue`:
|
|
1081
|
-
for (const newOwner of
|
|
1252
|
+
for (const newOwner of event.to) claimWithinStore(store, newOwner, event.key, event.exclusive ? `exclusive` : void 0);
|
|
1082
1253
|
break;
|
|
1083
1254
|
case `oldValue`:
|
|
1084
1255
|
{
|
|
1085
1256
|
let exclusivity = `exclusive`;
|
|
1086
|
-
for (const previousOwner of
|
|
1087
|
-
claimWithinStore(store, previousOwner,
|
|
1257
|
+
for (const previousOwner of event.from) {
|
|
1258
|
+
claimWithinStore(store, previousOwner, event.key, exclusivity);
|
|
1088
1259
|
exclusivity = void 0;
|
|
1089
1260
|
}
|
|
1090
1261
|
}
|
|
@@ -1093,39 +1264,39 @@ function ingestMoleculeTransferEvent(update, applying, store) {
|
|
|
1093
1264
|
}
|
|
1094
1265
|
|
|
1095
1266
|
//#endregion
|
|
1096
|
-
//#region src/internal/
|
|
1097
|
-
function
|
|
1267
|
+
//#region src/internal/events/ingest-selector-update.ts
|
|
1268
|
+
function ingestSelectorUpdateEvent(store, selectorUpdate, applying) {
|
|
1098
1269
|
let updates;
|
|
1099
1270
|
if (applying === `newValue`) updates = selectorUpdate.atomUpdates;
|
|
1100
1271
|
else updates = selectorUpdate.atomUpdates.toReversed();
|
|
1101
|
-
for (const atomUpdate of updates)
|
|
1272
|
+
for (const atomUpdate of updates) ingestAtomUpdateEvent(store, atomUpdate, applying);
|
|
1102
1273
|
}
|
|
1103
1274
|
|
|
1104
1275
|
//#endregion
|
|
1105
|
-
//#region src/internal/
|
|
1106
|
-
function
|
|
1107
|
-
const
|
|
1108
|
-
for (const
|
|
1276
|
+
//#region src/internal/events/ingest-transaction-update.ts
|
|
1277
|
+
function ingestTransactionOutcomeEvent(store, event, applying) {
|
|
1278
|
+
const subEvents = applying === `newValue` ? event.subEvents : [...event.subEvents].reverse();
|
|
1279
|
+
for (const subEvent of subEvents) switch (subEvent.type) {
|
|
1109
1280
|
case `atom_update`:
|
|
1110
|
-
|
|
1281
|
+
ingestAtomUpdateEvent(store, subEvent, applying);
|
|
1111
1282
|
break;
|
|
1112
1283
|
case `state_creation`:
|
|
1113
|
-
ingestCreationEvent(
|
|
1284
|
+
ingestCreationEvent(store, subEvent, applying);
|
|
1114
1285
|
break;
|
|
1115
1286
|
case `state_disposal`:
|
|
1116
|
-
ingestDisposalEvent(
|
|
1287
|
+
ingestDisposalEvent(store, subEvent, applying);
|
|
1117
1288
|
break;
|
|
1118
1289
|
case `molecule_creation`:
|
|
1119
|
-
ingestMoleculeCreationEvent(
|
|
1290
|
+
ingestMoleculeCreationEvent(store, subEvent, applying);
|
|
1120
1291
|
break;
|
|
1121
1292
|
case `molecule_disposal`:
|
|
1122
|
-
ingestMoleculeDisposalEvent(
|
|
1293
|
+
ingestMoleculeDisposalEvent(store, subEvent, applying);
|
|
1123
1294
|
break;
|
|
1124
1295
|
case `molecule_transfer`:
|
|
1125
|
-
ingestMoleculeTransferEvent(
|
|
1296
|
+
ingestMoleculeTransferEvent(store, subEvent, applying);
|
|
1126
1297
|
break;
|
|
1127
1298
|
case `transaction_outcome`:
|
|
1128
|
-
|
|
1299
|
+
ingestTransactionOutcomeEvent(store, subEvent, applying);
|
|
1129
1300
|
break;
|
|
1130
1301
|
}
|
|
1131
1302
|
}
|
|
@@ -1163,7 +1334,7 @@ function setEpochNumberOfAction(store, transactionKey, newEpoch) {
|
|
|
1163
1334
|
|
|
1164
1335
|
//#endregion
|
|
1165
1336
|
//#region src/internal/transaction/apply-transaction.ts
|
|
1166
|
-
|
|
1337
|
+
function applyTransaction(store, output) {
|
|
1167
1338
|
const child = newest(store);
|
|
1168
1339
|
const { parent } = child;
|
|
1169
1340
|
if (parent === null || !isChildStore(child) || child.transactionMeta?.phase !== `building`) {
|
|
@@ -1176,7 +1347,7 @@ const applyTransaction = (output, store) => {
|
|
|
1176
1347
|
parent.on.transactionApplying.next(child.transactionMeta);
|
|
1177
1348
|
const { subEvents: updates } = child.transactionMeta.update;
|
|
1178
1349
|
store.logger.info(`🛄`, `transaction`, child.transactionMeta.update.token.key, `Applying transaction with ${updates.length} updates:`, updates);
|
|
1179
|
-
|
|
1350
|
+
ingestTransactionOutcomeEvent(parent, child.transactionMeta.update, `newValue`);
|
|
1180
1351
|
if (isRootStore(parent)) {
|
|
1181
1352
|
setEpochNumberOfAction(parent, child.transactionMeta.update.token.key, child.transactionMeta.update.epoch);
|
|
1182
1353
|
const myTransaction = withdraw(store, {
|
|
@@ -1187,7 +1358,7 @@ const applyTransaction = (output, store) => {
|
|
|
1187
1358
|
store.logger.info(`🛬`, `transaction`, child.transactionMeta.update.token.key, `Finished applying transaction.`);
|
|
1188
1359
|
} else if (isChildStore(parent)) parent.transactionMeta.update.subEvents.push(child.transactionMeta.update);
|
|
1189
1360
|
parent.on.transactionApplying.next(null);
|
|
1190
|
-
}
|
|
1361
|
+
}
|
|
1191
1362
|
|
|
1192
1363
|
//#endregion
|
|
1193
1364
|
//#region src/internal/transaction/assign-transaction-to-continuity.ts
|
|
@@ -1205,40 +1376,6 @@ function getEnvironmentData(store) {
|
|
|
1205
1376
|
return { store };
|
|
1206
1377
|
}
|
|
1207
1378
|
|
|
1208
|
-
//#endregion
|
|
1209
|
-
//#region src/internal/lazy-map.ts
|
|
1210
|
-
var LazyMap = class extends Map {
|
|
1211
|
-
deleted = /* @__PURE__ */ new Set();
|
|
1212
|
-
source;
|
|
1213
|
-
constructor(source) {
|
|
1214
|
-
super();
|
|
1215
|
-
this.source = source;
|
|
1216
|
-
}
|
|
1217
|
-
get(key) {
|
|
1218
|
-
const has = super.has(key);
|
|
1219
|
-
if (has) return super.get(key);
|
|
1220
|
-
if (!this.deleted.has(key) && this.source.has(key)) {
|
|
1221
|
-
const value = this.source.get(key);
|
|
1222
|
-
return value;
|
|
1223
|
-
}
|
|
1224
|
-
return void 0;
|
|
1225
|
-
}
|
|
1226
|
-
set(key, value) {
|
|
1227
|
-
this.deleted.delete(key);
|
|
1228
|
-
return super.set(key, value);
|
|
1229
|
-
}
|
|
1230
|
-
hasOwn(key) {
|
|
1231
|
-
return super.has(key);
|
|
1232
|
-
}
|
|
1233
|
-
has(key) {
|
|
1234
|
-
return !this.deleted.has(key) && (super.has(key) || this.source.has(key));
|
|
1235
|
-
}
|
|
1236
|
-
delete(key) {
|
|
1237
|
-
this.deleted.add(key);
|
|
1238
|
-
return super.delete(key);
|
|
1239
|
-
}
|
|
1240
|
-
};
|
|
1241
|
-
|
|
1242
1379
|
//#endregion
|
|
1243
1380
|
//#region src/internal/transaction/build-transaction.ts
|
|
1244
1381
|
const buildTransaction = (store, token, params, id) => {
|
|
@@ -1250,27 +1387,27 @@ const buildTransaction = (store, token, params, id) => {
|
|
|
1250
1387
|
loggers: parent.loggers,
|
|
1251
1388
|
logger: parent.logger,
|
|
1252
1389
|
config: parent.config,
|
|
1253
|
-
atoms: new
|
|
1390
|
+
atoms: new MapOverlay(parent.atoms),
|
|
1254
1391
|
atomsThatAreDefault: new Set(parent.atomsThatAreDefault),
|
|
1255
|
-
families: new
|
|
1256
|
-
joins: new
|
|
1392
|
+
families: new MapOverlay(parent.families),
|
|
1393
|
+
joins: new MapOverlay(parent.joins),
|
|
1257
1394
|
operation: { open: false },
|
|
1258
|
-
readonlySelectors: new
|
|
1259
|
-
timelines: new
|
|
1260
|
-
timelineTopics:
|
|
1395
|
+
readonlySelectors: new MapOverlay(parent.readonlySelectors),
|
|
1396
|
+
timelines: new MapOverlay(parent.timelines),
|
|
1397
|
+
timelineTopics: parent.timelineTopics.overlay(),
|
|
1261
1398
|
trackers: /* @__PURE__ */ new Map(),
|
|
1262
|
-
transactions: new
|
|
1263
|
-
selectorAtoms:
|
|
1264
|
-
selectorGraph:
|
|
1265
|
-
writableSelectors: new
|
|
1266
|
-
valueMap: new
|
|
1399
|
+
transactions: new MapOverlay(parent.transactions),
|
|
1400
|
+
selectorAtoms: parent.selectorAtoms.overlay(),
|
|
1401
|
+
selectorGraph: parent.selectorGraph.overlay(),
|
|
1402
|
+
writableSelectors: new MapOverlay(parent.writableSelectors),
|
|
1403
|
+
valueMap: new MapOverlay(parent.valueMap),
|
|
1267
1404
|
defaults: parent.defaults,
|
|
1268
1405
|
disposalTraces: store.disposalTraces.copy(),
|
|
1269
|
-
molecules: new
|
|
1270
|
-
moleculeGraph:
|
|
1271
|
-
moleculeData:
|
|
1272
|
-
moleculeJoins:
|
|
1273
|
-
miscResources: new
|
|
1406
|
+
molecules: new MapOverlay(parent.molecules),
|
|
1407
|
+
moleculeGraph: parent.moleculeGraph.overlay(),
|
|
1408
|
+
moleculeData: parent.moleculeData.overlay(),
|
|
1409
|
+
moleculeJoins: parent.moleculeJoins.overlay(),
|
|
1410
|
+
miscResources: new MapOverlay(parent.miscResources)
|
|
1274
1411
|
};
|
|
1275
1412
|
const epoch = getEpochNumberOfAction(store, token.key);
|
|
1276
1413
|
const transactionMeta = {
|
|
@@ -1323,7 +1460,7 @@ function createTransaction(store, options) {
|
|
|
1323
1460
|
const target$1 = newest(store);
|
|
1324
1461
|
const { toolkit } = childStore.transactionMeta;
|
|
1325
1462
|
const output = options.do(toolkit, ...params);
|
|
1326
|
-
applyTransaction(
|
|
1463
|
+
applyTransaction(target$1, output);
|
|
1327
1464
|
return output;
|
|
1328
1465
|
} catch (thrown) {
|
|
1329
1466
|
abortTransaction(target);
|
|
@@ -1350,59 +1487,74 @@ const TRANSACTION_PHASES = [
|
|
|
1350
1487
|
];
|
|
1351
1488
|
|
|
1352
1489
|
//#endregion
|
|
1353
|
-
//#region src/internal/
|
|
1354
|
-
function
|
|
1355
|
-
const
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
case void 0:
|
|
1371
|
-
willCreate = false;
|
|
1372
|
-
break;
|
|
1373
|
-
}
|
|
1374
|
-
const stringKey = stringifyJson(key);
|
|
1375
|
-
const molecule = store.molecules.get(stringKey);
|
|
1376
|
-
if (!molecule && store.config.lifespan === `immortal`) {
|
|
1377
|
-
const fakeToken = mint(familyToken, key, COUNTERFEIT);
|
|
1378
|
-
store.logger.warn(`💣`, `key`, stringKey, `was used to mint a counterfeit token for`, familyToken.type, `"${familyToken.key}"`);
|
|
1379
|
-
return fakeToken;
|
|
1380
|
-
}
|
|
1381
|
-
if (willCreate) {
|
|
1382
|
-
stateToken = initFamilyMemberInStore(store, familyToken, key);
|
|
1383
|
-
const target = newest(store);
|
|
1384
|
-
if (stateToken.family) {
|
|
1385
|
-
if (isRootStore(target)) switch (stateToken.type) {
|
|
1490
|
+
//#region src/internal/set-state/dispatch-state-update.ts
|
|
1491
|
+
function dispatchOrDeferStateUpdate(target, state, { oldValue, newValue }, stateIsNewlyCreated, family) {
|
|
1492
|
+
const token = deposit(state);
|
|
1493
|
+
if (stateIsNewlyCreated && family) {
|
|
1494
|
+
state.subject.next({ newValue });
|
|
1495
|
+
const stateCreationEvent = {
|
|
1496
|
+
type: `state_creation`,
|
|
1497
|
+
subType: `writable`,
|
|
1498
|
+
token,
|
|
1499
|
+
timestamp: Date.now(),
|
|
1500
|
+
value: newValue
|
|
1501
|
+
};
|
|
1502
|
+
const familySubject = family.subject;
|
|
1503
|
+
familySubject.next(stateCreationEvent);
|
|
1504
|
+
const innerTarget = newest(target);
|
|
1505
|
+
if (token.family) {
|
|
1506
|
+
if (isRootStore(innerTarget)) switch (token.type) {
|
|
1386
1507
|
case `atom`:
|
|
1387
1508
|
case `mutable_atom`:
|
|
1388
|
-
|
|
1509
|
+
target.on.atomCreation.next(token);
|
|
1389
1510
|
break;
|
|
1390
1511
|
case `writable_pure_selector`:
|
|
1391
|
-
case `readonly_pure_selector`:
|
|
1392
1512
|
case `writable_held_selector`:
|
|
1393
|
-
|
|
1394
|
-
store.on.selectorCreation.next(stateToken);
|
|
1513
|
+
target.on.selectorCreation.next(token);
|
|
1395
1514
|
break;
|
|
1396
1515
|
}
|
|
1397
|
-
else if (isChildStore(
|
|
1398
|
-
type: `state_creation`,
|
|
1399
|
-
token: stateToken,
|
|
1400
|
-
timestamp: Date.now()
|
|
1401
|
-
});
|
|
1516
|
+
else if (isChildStore(innerTarget) && innerTarget.on.transactionApplying.state === null) innerTarget.transactionMeta.update.subEvents.push(stateCreationEvent);
|
|
1402
1517
|
}
|
|
1403
|
-
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1518
|
+
return;
|
|
1519
|
+
}
|
|
1520
|
+
const { key, subject, type } = state;
|
|
1521
|
+
const update = {
|
|
1522
|
+
oldValue: isTransceiver(oldValue) ? oldValue.READONLY_VIEW : oldValue,
|
|
1523
|
+
newValue: isTransceiver(newValue) ? newValue.READONLY_VIEW : newValue
|
|
1524
|
+
};
|
|
1525
|
+
if (isRootStore(target)) {
|
|
1526
|
+
switch (type) {
|
|
1527
|
+
case `mutable_atom`:
|
|
1528
|
+
target.logger.info(`📢`, type, key, `is now (`, newValue, `) subscribers:`, subject.subscribers);
|
|
1529
|
+
break;
|
|
1530
|
+
case `atom`:
|
|
1531
|
+
case `writable_pure_selector`:
|
|
1532
|
+
case `writable_held_selector`: target.logger.info(`📢`, type, key, `went (`, oldValue, `->`, newValue, `) subscribers:`, subject.subscribers);
|
|
1533
|
+
}
|
|
1534
|
+
subject.next(update);
|
|
1535
|
+
}
|
|
1536
|
+
if (isChildStore(target) && (type === `mutable_atom` || type === `atom`)) {
|
|
1537
|
+
if (target.on.transactionApplying.state === null) {
|
|
1538
|
+
if (isTransceiver(newValue)) return;
|
|
1539
|
+
const { timestamp } = target.operation;
|
|
1540
|
+
const atomUpdate = {
|
|
1541
|
+
type: `atom_update`,
|
|
1542
|
+
token,
|
|
1543
|
+
timestamp,
|
|
1544
|
+
update
|
|
1545
|
+
};
|
|
1546
|
+
target.transactionMeta.update.subEvents.push(atomUpdate);
|
|
1547
|
+
target.logger.info(`📁`, `atom`, key, `stowed (`, oldValue, `->`, newValue, `)`);
|
|
1548
|
+
return;
|
|
1549
|
+
}
|
|
1550
|
+
if (hasRole(state, `tracker:signal`)) {
|
|
1551
|
+
const keyOfMutable = key.slice(1);
|
|
1552
|
+
const mutable = target.atoms.get(keyOfMutable);
|
|
1553
|
+
const transceiver = readOrComputeValue(target, mutable, `mut`);
|
|
1554
|
+
const accepted = transceiver.do(update.newValue) === null;
|
|
1555
|
+
if (accepted === true) evictDownstreamFromAtom(target, mutable);
|
|
1556
|
+
}
|
|
1557
|
+
}
|
|
1406
1558
|
}
|
|
1407
1559
|
|
|
1408
1560
|
//#endregion
|
|
@@ -1423,20 +1575,16 @@ function operateOnStore(store, opMode, ...params) {
|
|
|
1423
1575
|
family = getFamilyOfToken(store, token);
|
|
1424
1576
|
key = parseJson(token.family.subKey);
|
|
1425
1577
|
existingToken = seekInStore(store, family, key);
|
|
1426
|
-
if (!existingToken)
|
|
1427
|
-
|
|
1428
|
-
token = brandNewToken;
|
|
1429
|
-
} else token = existingToken;
|
|
1578
|
+
if (!existingToken) token = brandNewToken = mintInStore(store, family, key, MUST_CREATE);
|
|
1579
|
+
else token = existingToken;
|
|
1430
1580
|
}
|
|
1431
1581
|
} else {
|
|
1432
|
-
family = params[0];
|
|
1582
|
+
family = withdraw(store, params[0]);
|
|
1433
1583
|
key = params[1];
|
|
1434
1584
|
value = params[2];
|
|
1435
1585
|
existingToken = seekInStore(store, family, key);
|
|
1436
|
-
if (!existingToken)
|
|
1437
|
-
|
|
1438
|
-
token = brandNewToken;
|
|
1439
|
-
} else token = existingToken;
|
|
1586
|
+
if (!existingToken) token = brandNewToken = mintInStore(store, family, key, MUST_CREATE);
|
|
1587
|
+
else token = existingToken;
|
|
1440
1588
|
}
|
|
1441
1589
|
const action = value === RESET_STATE ? `reset` : `set`;
|
|
1442
1590
|
let target;
|
|
@@ -1465,7 +1613,7 @@ function operateOnStore(store, opMode, ...params) {
|
|
|
1465
1613
|
if (value === RESET_STATE) protoUpdate = resetAtomOrSelector(target, state);
|
|
1466
1614
|
else protoUpdate = setAtomOrSelector(target, state, value);
|
|
1467
1615
|
const isNewlyCreated = Boolean(brandNewToken);
|
|
1468
|
-
dispatchOrDeferStateUpdate(target, state, protoUpdate, isNewlyCreated);
|
|
1616
|
+
dispatchOrDeferStateUpdate(target, state, protoUpdate, isNewlyCreated, family);
|
|
1469
1617
|
if (opMode === OWN_OP) closeOperation(target);
|
|
1470
1618
|
}
|
|
1471
1619
|
|
|
@@ -1528,12 +1676,10 @@ function registerSelector(store, selectorType, selectorKey, covered) {
|
|
|
1528
1676
|
return {
|
|
1529
1677
|
get: (...params) => {
|
|
1530
1678
|
const target = newest(store);
|
|
1531
|
-
const { token,
|
|
1679
|
+
const { token, family, subKey } = reduceReference(store, ...params);
|
|
1532
1680
|
let dependencyValue;
|
|
1533
|
-
if (`counterfeit` in token &&
|
|
1534
|
-
|
|
1535
|
-
dependencyValue = getFallback(store, token, dependencyFamily, subKey);
|
|
1536
|
-
} else {
|
|
1681
|
+
if (`counterfeit` in token && family && subKey) dependencyValue = getFallback(store, token, family, subKey);
|
|
1682
|
+
else {
|
|
1537
1683
|
const dependency = withdraw(store, token);
|
|
1538
1684
|
dependencyValue = readOrComputeValue(store, dependency);
|
|
1539
1685
|
}
|
|
@@ -1562,6 +1708,7 @@ function createReadonlyHeldSelector(store, options, family) {
|
|
|
1562
1708
|
const covered = /* @__PURE__ */ new Set();
|
|
1563
1709
|
const { key, const: constant } = options;
|
|
1564
1710
|
const type = `readonly_held_selector`;
|
|
1711
|
+
store.logger.info(`🔨`, type, key, `is being created`);
|
|
1565
1712
|
const { get, find, json } = registerSelector(target, type, key, covered);
|
|
1566
1713
|
const getFrom = (innerTarget) => {
|
|
1567
1714
|
const upstreamStates = innerTarget.selectorGraph.getRelationEntries({ downstreamSelectorKey: key });
|
|
@@ -1573,6 +1720,7 @@ function createReadonlyHeldSelector(store, options, family) {
|
|
|
1573
1720
|
json
|
|
1574
1721
|
}, constant);
|
|
1575
1722
|
writeToCache(innerTarget, readonlySelector, constant);
|
|
1723
|
+
store.logger.info(`✨`, type, key, `=`, constant);
|
|
1576
1724
|
covered.clear();
|
|
1577
1725
|
return constant;
|
|
1578
1726
|
};
|
|
@@ -1585,7 +1733,6 @@ function createReadonlyHeldSelector(store, options, family) {
|
|
|
1585
1733
|
};
|
|
1586
1734
|
if (family) readonlySelector.family = family;
|
|
1587
1735
|
target.readonlySelectors.set(key, readonlySelector);
|
|
1588
|
-
store.logger.info(`✨`, type, key, `=`, constant);
|
|
1589
1736
|
const token = {
|
|
1590
1737
|
key,
|
|
1591
1738
|
type
|
|
@@ -1602,6 +1749,7 @@ function createReadonlyPureSelector(store, options, family) {
|
|
|
1602
1749
|
const covered = /* @__PURE__ */ new Set();
|
|
1603
1750
|
const key = options.key;
|
|
1604
1751
|
const type = `readonly_pure_selector`;
|
|
1752
|
+
store.logger.info(`🔨`, type, key, `is being created`);
|
|
1605
1753
|
const { get, find, json } = registerSelector(target, type, key, covered);
|
|
1606
1754
|
const getFrom = () => {
|
|
1607
1755
|
const innerTarget = newest(store);
|
|
@@ -1643,6 +1791,7 @@ function createWritableHeldSelector(store, options, family) {
|
|
|
1643
1791
|
const covered = /* @__PURE__ */ new Set();
|
|
1644
1792
|
const { key, const: constant } = options;
|
|
1645
1793
|
const type = `writable_held_selector`;
|
|
1794
|
+
store.logger.info(`🔨`, type, key, `is being created`);
|
|
1646
1795
|
const setterToolkit = registerSelector(target, type, key, covered);
|
|
1647
1796
|
const { find, get, json } = setterToolkit;
|
|
1648
1797
|
const getterToolkit = {
|
|
@@ -1689,6 +1838,7 @@ function createWritablePureSelector(store, options, family) {
|
|
|
1689
1838
|
const covered = /* @__PURE__ */ new Set();
|
|
1690
1839
|
const key = options.key;
|
|
1691
1840
|
const type = `writable_pure_selector`;
|
|
1841
|
+
store.logger.info(`🔨`, type, key, `is being created`);
|
|
1692
1842
|
const setterToolkit = registerSelector(target, type, key, covered);
|
|
1693
1843
|
const { find, get, json } = setterToolkit;
|
|
1694
1844
|
const getterToolkit = {
|
|
@@ -1719,8 +1869,6 @@ function createWritablePureSelector(store, options, family) {
|
|
|
1719
1869
|
};
|
|
1720
1870
|
if (family) mySelector.family = family;
|
|
1721
1871
|
target.writableSelectors.set(key, mySelector);
|
|
1722
|
-
const initialValue = getFrom(target);
|
|
1723
|
-
store.logger.info(`✨`, mySelector.type, mySelector.key, `=`, initialValue);
|
|
1724
1872
|
const token = {
|
|
1725
1873
|
key,
|
|
1726
1874
|
type
|
|
@@ -1869,11 +2017,6 @@ function createReadonlyPureSelectorFamily(store, options, internalRoles) {
|
|
|
1869
2017
|
key: fullKey,
|
|
1870
2018
|
get: options.get(key)
|
|
1871
2019
|
}, family);
|
|
1872
|
-
subject.next({
|
|
1873
|
-
type: `state_creation`,
|
|
1874
|
-
token,
|
|
1875
|
-
timestamp: Date.now()
|
|
1876
|
-
});
|
|
1877
2020
|
return token;
|
|
1878
2021
|
};
|
|
1879
2022
|
const readonlySelectorFamily = Object.assign(familyFunction, familyToken, {
|
|
@@ -1914,15 +2057,10 @@ function createRegularAtomFamily(store, options, internalRoles) {
|
|
|
1914
2057
|
const def = options.default;
|
|
1915
2058
|
const individualOptions = {
|
|
1916
2059
|
key: fullKey,
|
|
1917
|
-
default: def
|
|
2060
|
+
default: isFn(def) ? () => def(key) : def
|
|
1918
2061
|
};
|
|
1919
2062
|
if (options.effects) individualOptions.effects = options.effects(key);
|
|
1920
2063
|
const token = createRegularAtom(target, individualOptions, family);
|
|
1921
|
-
subject.next({
|
|
1922
|
-
type: `state_creation`,
|
|
1923
|
-
token,
|
|
1924
|
-
timestamp: Date.now()
|
|
1925
|
-
});
|
|
1926
2064
|
return token;
|
|
1927
2065
|
};
|
|
1928
2066
|
const atomFamily$1 = Object.assign(familyFunction, familyToken, {
|
|
@@ -1932,7 +2070,7 @@ function createRegularAtomFamily(store, options, internalRoles) {
|
|
|
1932
2070
|
internalRoles
|
|
1933
2071
|
});
|
|
1934
2072
|
store.families.set(options.key, atomFamily$1);
|
|
1935
|
-
if (options.default
|
|
2073
|
+
if (isFn(options.default) === false) store.defaults.set(options.key, options.default);
|
|
1936
2074
|
return familyToken;
|
|
1937
2075
|
}
|
|
1938
2076
|
|
|
@@ -1961,11 +2099,6 @@ function createReadonlyHeldSelectorFamily(store, options, internalRoles) {
|
|
|
1961
2099
|
const: options.const(key),
|
|
1962
2100
|
get: options.get(key)
|
|
1963
2101
|
}, family);
|
|
1964
|
-
subject.next({
|
|
1965
|
-
type: `state_creation`,
|
|
1966
|
-
token,
|
|
1967
|
-
timestamp: Date.now()
|
|
1968
|
-
});
|
|
1969
2102
|
return token;
|
|
1970
2103
|
};
|
|
1971
2104
|
const readonlySelectorFamily = Object.assign(familyFunction, familyToken, {
|
|
@@ -2004,11 +2137,6 @@ function createWritableHeldSelectorFamily(store, options, internalRoles) {
|
|
|
2004
2137
|
get: options.get(key),
|
|
2005
2138
|
set: options.set(key)
|
|
2006
2139
|
}, family);
|
|
2007
|
-
subject.next({
|
|
2008
|
-
type: `state_creation`,
|
|
2009
|
-
token,
|
|
2010
|
-
timestamp: Date.now()
|
|
2011
|
-
});
|
|
2012
2140
|
return token;
|
|
2013
2141
|
};
|
|
2014
2142
|
const selectorFamily$1 = Object.assign(familyFunction, familyToken, {
|
|
@@ -2046,11 +2174,6 @@ function createWritablePureSelectorFamily(store, options, internalRoles) {
|
|
|
2046
2174
|
get: options.get(key),
|
|
2047
2175
|
set: options.set(key)
|
|
2048
2176
|
}, family);
|
|
2049
|
-
subject.next({
|
|
2050
|
-
type: `state_creation`,
|
|
2051
|
-
token,
|
|
2052
|
-
timestamp: Date.now()
|
|
2053
|
-
});
|
|
2054
2177
|
return token;
|
|
2055
2178
|
};
|
|
2056
2179
|
const selectorFamily$1 = Object.assign(familyFunction, familyToken, {
|
|
@@ -2109,10 +2232,10 @@ function seekInStore(store, token, key) {
|
|
|
2109
2232
|
//#endregion
|
|
2110
2233
|
//#region src/internal/families/find-in-store.ts
|
|
2111
2234
|
function findInStore(store, familyToken, key) {
|
|
2112
|
-
withdraw(store, familyToken);
|
|
2235
|
+
const family = withdraw(store, familyToken);
|
|
2113
2236
|
const existingStateToken = seekInStore(store, familyToken, key);
|
|
2114
2237
|
if (existingStateToken) return existingStateToken;
|
|
2115
|
-
const newStateToken = mintInStore(store,
|
|
2238
|
+
const newStateToken = mintInStore(store, family, key);
|
|
2116
2239
|
return newStateToken;
|
|
2117
2240
|
}
|
|
2118
2241
|
|
|
@@ -2152,19 +2275,19 @@ function disposeFromStore(store, ...params) {
|
|
|
2152
2275
|
function reduceReference(store, ...params) {
|
|
2153
2276
|
let existingToken;
|
|
2154
2277
|
let brandNewToken;
|
|
2155
|
-
let
|
|
2278
|
+
let family;
|
|
2156
2279
|
let subKey;
|
|
2157
2280
|
let token;
|
|
2158
2281
|
if (params.length === 1) {
|
|
2159
2282
|
token = params[0];
|
|
2160
2283
|
if (`family` in token) {
|
|
2161
|
-
familyToken = getFamilyOfToken(store, token);
|
|
2162
|
-
withdraw(store, familyToken);
|
|
2284
|
+
const familyToken = getFamilyOfToken(store, token);
|
|
2285
|
+
family = withdraw(store, familyToken);
|
|
2163
2286
|
subKey = parseJson(token.family.subKey);
|
|
2164
2287
|
existingToken = seekInStore(store, familyToken, subKey);
|
|
2165
2288
|
if (`counterfeit` in token) return {
|
|
2166
2289
|
token,
|
|
2167
|
-
|
|
2290
|
+
family,
|
|
2168
2291
|
subKey,
|
|
2169
2292
|
isNew: false
|
|
2170
2293
|
};
|
|
@@ -2174,17 +2297,45 @@ function reduceReference(store, ...params) {
|
|
|
2174
2297
|
} else token = existingToken;
|
|
2175
2298
|
}
|
|
2176
2299
|
} else {
|
|
2177
|
-
|
|
2300
|
+
family = withdraw(store, params[0]);
|
|
2178
2301
|
subKey = params[1];
|
|
2179
|
-
existingToken = seekInStore(store,
|
|
2302
|
+
existingToken = seekInStore(store, family, subKey);
|
|
2180
2303
|
if (!existingToken) {
|
|
2181
|
-
brandNewToken = mintInStore(store,
|
|
2304
|
+
brandNewToken = mintInStore(store, family, subKey, MUST_CREATE);
|
|
2182
2305
|
token = brandNewToken;
|
|
2183
2306
|
} else token = existingToken;
|
|
2184
2307
|
}
|
|
2308
|
+
const isCounterfeit = `counterfeit` in token;
|
|
2309
|
+
const isNewlyCreated = Boolean(brandNewToken) && isCounterfeit === false;
|
|
2310
|
+
if (isNewlyCreated && family) {
|
|
2311
|
+
const stateCreationEvent = {
|
|
2312
|
+
type: `state_creation`,
|
|
2313
|
+
subType: `readable`,
|
|
2314
|
+
token,
|
|
2315
|
+
timestamp: Date.now()
|
|
2316
|
+
};
|
|
2317
|
+
const familySubject = family.subject;
|
|
2318
|
+
familySubject.next(stateCreationEvent);
|
|
2319
|
+
const target = newest(store);
|
|
2320
|
+
if (token.family) {
|
|
2321
|
+
if (isRootStore(target)) switch (token.type) {
|
|
2322
|
+
case `atom`:
|
|
2323
|
+
case `mutable_atom`:
|
|
2324
|
+
store.on.atomCreation.next(token);
|
|
2325
|
+
break;
|
|
2326
|
+
case `writable_pure_selector`:
|
|
2327
|
+
case `readonly_pure_selector`:
|
|
2328
|
+
case `writable_held_selector`:
|
|
2329
|
+
case `readonly_held_selector`:
|
|
2330
|
+
store.on.selectorCreation.next(token);
|
|
2331
|
+
break;
|
|
2332
|
+
}
|
|
2333
|
+
else if (isChildStore(target) && target.on.transactionApplying.state === null) target.transactionMeta.update.subEvents.push(stateCreationEvent);
|
|
2334
|
+
}
|
|
2335
|
+
}
|
|
2185
2336
|
return {
|
|
2186
2337
|
token,
|
|
2187
|
-
|
|
2338
|
+
family,
|
|
2188
2339
|
subKey,
|
|
2189
2340
|
isNew: Boolean(brandNewToken)
|
|
2190
2341
|
};
|
|
@@ -2193,11 +2344,8 @@ function reduceReference(store, ...params) {
|
|
|
2193
2344
|
//#endregion
|
|
2194
2345
|
//#region src/internal/get-state/get-from-store.ts
|
|
2195
2346
|
function getFromStore(store, ...params) {
|
|
2196
|
-
const { token,
|
|
2197
|
-
if (`counterfeit` in token &&
|
|
2198
|
-
const family = withdraw(store, familyToken);
|
|
2199
|
-
return getFallback(store, token, family, subKey);
|
|
2200
|
-
}
|
|
2347
|
+
const { token, family, subKey } = reduceReference(store, ...params);
|
|
2348
|
+
if (`counterfeit` in token && family && subKey) return getFallback(store, token, family, subKey);
|
|
2201
2349
|
const state = withdraw(store, token);
|
|
2202
2350
|
return readOrComputeValue(store, state);
|
|
2203
2351
|
}
|
|
@@ -2547,11 +2695,6 @@ function createMutableAtomFamily(store, options, internalRoles) {
|
|
|
2547
2695
|
};
|
|
2548
2696
|
if (options.effects) individualOptions.effects = options.effects(key);
|
|
2549
2697
|
const token = createMutableAtom(target, individualOptions, family);
|
|
2550
|
-
subject.next({
|
|
2551
|
-
type: `state_creation`,
|
|
2552
|
-
token,
|
|
2553
|
-
timestamp: Date.now()
|
|
2554
|
-
});
|
|
2555
2698
|
return token;
|
|
2556
2699
|
};
|
|
2557
2700
|
const atomFamily$1 = Object.assign(familyFunction, familyToken, {
|
|
@@ -2767,7 +2910,7 @@ const clearStore = (store) => {
|
|
|
2767
2910
|
function createRegularAtom(store, options, family, internalRoles) {
|
|
2768
2911
|
const type = `atom`;
|
|
2769
2912
|
const { key } = options;
|
|
2770
|
-
store.logger.info(`🔨`,
|
|
2913
|
+
store.logger.info(`🔨`, type, key, `is being created`);
|
|
2771
2914
|
const target = newest(store);
|
|
2772
2915
|
const existing = target.atoms.get(key);
|
|
2773
2916
|
if (existing && existing.type === type) {
|
|
@@ -3609,23 +3752,23 @@ const timeTravel = (store, action, token) => {
|
|
|
3609
3752
|
}
|
|
3610
3753
|
timelineData.timeTraveling = action === `redo` ? `into_future` : `into_past`;
|
|
3611
3754
|
if (action === `undo`) --timelineData.at;
|
|
3612
|
-
const
|
|
3755
|
+
const event = timelineData.history[timelineData.at];
|
|
3613
3756
|
const applying = action === `redo` ? `newValue` : `oldValue`;
|
|
3614
|
-
switch (
|
|
3757
|
+
switch (event.type) {
|
|
3615
3758
|
case `atom_update`:
|
|
3616
|
-
|
|
3759
|
+
ingestAtomUpdateEvent(store, event, applying);
|
|
3617
3760
|
break;
|
|
3618
3761
|
case `selector_update`:
|
|
3619
|
-
|
|
3762
|
+
ingestSelectorUpdateEvent(store, event, applying);
|
|
3620
3763
|
break;
|
|
3621
3764
|
case `transaction_outcome`:
|
|
3622
|
-
|
|
3765
|
+
ingestTransactionOutcomeEvent(store, event, applying);
|
|
3623
3766
|
break;
|
|
3624
3767
|
case `state_creation`:
|
|
3625
|
-
ingestCreationEvent(
|
|
3768
|
+
ingestCreationEvent(store, event, applying);
|
|
3626
3769
|
break;
|
|
3627
3770
|
case `state_disposal`:
|
|
3628
|
-
ingestDisposalEvent(
|
|
3771
|
+
ingestDisposalEvent(store, event, applying);
|
|
3629
3772
|
break;
|
|
3630
3773
|
case `molecule_creation`:
|
|
3631
3774
|
case `molecule_disposal`:
|
|
@@ -3637,5 +3780,5 @@ const timeTravel = (store, action, token) => {
|
|
|
3637
3780
|
};
|
|
3638
3781
|
|
|
3639
3782
|
//#endregion
|
|
3640
|
-
export { COUNTERFEIT, CircularBuffer, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, INTERNAL_ROLES, Join, Junction,
|
|
3783
|
+
export { COUNTERFEIT, CircularBuffer, FAMILY_MEMBER_TOKEN_TYPES, FamilyTracker, Future, IMPLICIT, INTERNAL_ROLES, Join, Junction, MapOverlay, NotFoundError, RESET_STATE, RelationsOverlay, SetOverlay, StatefulSubject, Store, Subject, TRANSACTION_PHASES, Tracker, abortTransaction, actUponStore, allocateIntoStore, applyTransaction, arbitrary, assignTransactionToContinuity, become, buildTransaction, capitalize, claimWithinStore, clearStore, closeOperation, createJoin, createMutableAtom, createMutableAtomFamily, createReadonlyHeldSelector, createReadonlyPureSelector, createReadonlyPureSelectorFamily, createRegularAtom, createRegularAtomFamily, createSelectorFamily, createStandaloneSelector, createTimeline, createTransaction, createWritableHeldSelector, createWritablePureSelector, createWritablePureSelectorFamily, deallocateFromStore, deposit, disposeAtom, disposeFromStore, disposeSelector, editRelationsInStore, evictCachedValue, evictDownstreamFromAtom, evictDownstreamFromSelector, findInStore, findRelationsInStore, fuseWithinStore, getContinuityKey, getEnvironmentData, getEpochNumberOfAction, getEpochNumberOfContinuity, getFromStore, getInternalRelationsFromStore, getJoin, getJsonFamily, getJsonToken, getSelectorDependencyKeys, getTrace, getUpdateFamily, getUpdateToken, hasRole, ingestAtomUpdateEvent, ingestCreationEvent, ingestDisposalEvent, ingestMoleculeCreationEvent, ingestMoleculeDisposalEvent, ingestMoleculeTransferEvent, ingestSelectorUpdateEvent, ingestTransactionOutcomeEvent, installIntoStore, isAtomKey, isChildStore, isDone, isReadonlySelectorKey, isReservedIntrospectionKey, isRootStore, isSelectorKey, isStateKey, isTransceiver, makeRootMoleculeInStore, markDone, mint, newest, openOperation, readFromCache, readOrComputeValue, recallState, registerSelector, resetAtomOrSelector, resetInStore, seekInStore, setAtomOrSelector, setEpochNumberOfAction, setEpochNumberOfContinuity, setIntoStore, subscribeInStore, subscribeToRootDependency, subscribeToState, subscribeToTimeline, subscribeToTransaction, timeTravel, traceRootSelectorAtoms, updateSelectorAtoms, withdraw, writeToCache };
|
|
3641
3784
|
//# sourceMappingURL=index.js.map
|