atom.io 0.27.4 → 0.28.0
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.d.ts +31 -29
- package/data/dist/index.js +65 -81
- package/data/src/dict.ts +9 -12
- package/data/src/join.ts +30 -33
- package/data/src/struct-family.ts +17 -23
- package/data/src/struct.ts +9 -12
- package/dist/{chunk-JRENM6KL.js → chunk-BX3MTH2Z.js} +482 -385
- package/dist/chunk-D52JNVER.js +721 -0
- package/dist/chunk-EUVKUTW3.js +89 -0
- package/dist/index.d.ts +4 -3
- package/dist/index.js +35 -53
- package/ephemeral/dist/index.js +1 -1
- package/ephemeral/src/find-state.ts +1 -1
- package/immortal/dist/index.js +2 -2
- package/immortal/src/seek-state.ts +2 -2
- package/internal/dist/index.d.ts +141 -87
- package/internal/dist/index.js +1 -1
- package/internal/src/atom/create-regular-atom.ts +3 -3
- package/internal/src/atom/create-standalone-atom.ts +7 -5
- package/internal/src/atom/dispose-atom.ts +2 -9
- package/internal/src/families/create-atom-family.ts +5 -5
- package/internal/src/families/create-readonly-selector-family.ts +20 -9
- package/internal/src/families/create-regular-atom-family.ts +15 -6
- package/internal/src/families/create-selector-family.ts +5 -5
- package/internal/src/families/create-writable-selector-family.ts +20 -10
- package/internal/src/families/dispose-from-store.ts +43 -29
- package/internal/src/families/find-in-store.ts +28 -18
- package/internal/src/families/init-family-member.ts +9 -9
- package/internal/src/families/seek-in-store.ts +10 -10
- package/internal/src/get-state/get-from-store.ts +70 -47
- package/internal/src/ingest-updates/ingest-atom-update.ts +1 -1
- package/internal/src/ingest-updates/ingest-creation-disposal.ts +15 -6
- package/internal/src/molecule/create-molecule-family.ts +1 -1
- package/internal/src/molecule/dispose-molecule.ts +7 -18
- package/internal/src/molecule/grow-molecule-in-store.ts +1 -1
- package/internal/src/molecule/make-molecule-in-store.ts +5 -5
- package/internal/src/mutable/create-mutable-atom-family.ts +15 -6
- package/internal/src/mutable/create-mutable-atom.ts +3 -3
- package/internal/src/mutable/get-json-token.ts +2 -2
- package/internal/src/mutable/tracker-family.ts +3 -3
- package/internal/src/mutable/tracker.ts +14 -18
- package/internal/src/pretty-print.ts +1 -16
- package/internal/src/selector/create-readonly-selector.ts +2 -2
- package/internal/src/selector/create-standalone-selector.ts +5 -5
- package/internal/src/selector/create-writable-selector.ts +2 -2
- package/internal/src/selector/dispose-selector.ts +2 -9
- package/internal/src/selector/register-selector.ts +9 -9
- package/internal/src/set-state/set-into-store.ts +23 -33
- package/internal/src/store/circular-buffer.ts +34 -0
- package/internal/src/store/counterfeit.ts +109 -0
- package/internal/src/store/deposit.ts +67 -13
- package/internal/src/store/index.ts +1 -0
- package/internal/src/store/store.ts +4 -1
- package/internal/src/store/withdraw.ts +15 -10
- package/internal/src/subscribe/index.ts +2 -0
- package/internal/src/subscribe/subscribe-in-store.ts +62 -0
- package/internal/src/timeline/time-travel.ts +1 -1
- package/internal/src/transaction/build-transaction.ts +7 -6
- package/introspection/dist/index.d.ts +84 -4
- package/introspection/dist/index.js +1 -413
- package/introspection/src/attach-atom-index.ts +5 -8
- package/introspection/src/attach-introspection-states.ts +7 -4
- package/introspection/src/attach-selector-index.ts +6 -8
- package/introspection/src/attach-timeline-family.ts +25 -28
- package/introspection/src/attach-timeline-index.ts +5 -8
- package/introspection/src/attach-transaction-index.ts +5 -8
- package/introspection/src/attach-transaction-logs.ts +21 -27
- package/introspection/src/attach-type-selectors.ts +26 -0
- package/introspection/src/differ.ts +167 -0
- package/introspection/src/index.ts +2 -0
- package/introspection/src/refinery.ts +100 -0
- package/json/dist/index.d.ts +31 -30
- package/json/dist/index.js +2 -80
- package/json/src/entries.ts +6 -0
- package/json/src/index.ts +47 -6
- package/json/src/select-json-family.ts +4 -4
- package/json/src/select-json.ts +6 -9
- package/package.json +17 -8
- package/react/dist/index.js +7 -7
- package/react/src/parse-state-overloads.ts +2 -2
- package/react/src/use-i.ts +1 -1
- package/react/src/use-json.ts +2 -2
- package/react/src/use-o.ts +2 -2
- package/react-devtools/dist/index.d.ts +1 -91
- package/react-devtools/dist/index.js +285 -414
- package/react-devtools/src/AtomIODevtools.tsx +2 -2
- package/react-devtools/src/StateEditor.tsx +20 -12
- package/react-devtools/src/StateIndex.tsx +8 -26
- package/react-devtools/src/TimelineIndex.tsx +3 -3
- package/react-devtools/src/TransactionIndex.tsx +6 -6
- package/react-devtools/src/Updates.tsx +1 -4
- package/react-devtools/src/index.ts +0 -71
- package/react-devtools/src/store.ts +51 -0
- package/realtime/dist/index.d.ts +7 -7
- package/realtime/dist/index.js +18 -22
- package/realtime/src/realtime-continuity.ts +27 -35
- package/realtime-client/dist/index.js +59 -65
- package/realtime-client/src/pull-atom-family-member.ts +1 -1
- package/realtime-client/src/pull-atom.ts +1 -1
- package/realtime-client/src/pull-mutable-atom-family-member.ts +3 -3
- package/realtime-client/src/pull-mutable-atom.ts +3 -3
- package/realtime-client/src/realtime-client-stores/client-main-store.ts +6 -6
- package/realtime-client/src/sync-continuity.ts +55 -53
- package/realtime-react/dist/index.js +3 -3
- package/realtime-react/src/use-pull-atom-family-member.ts +1 -1
- package/realtime-react/src/use-pull-mutable-family-member.ts +1 -1
- package/realtime-react/src/use-pull-selector-family-member.ts +1 -1
- package/realtime-server/dist/index.js +72 -36
- package/realtime-server/src/realtime-continuity-synchronizer.ts +57 -93
- package/realtime-server/src/realtime-family-provider.ts +3 -3
- package/realtime-server/src/realtime-mutable-family-provider.ts +5 -5
- package/realtime-server/src/realtime-mutable-provider.ts +2 -2
- package/realtime-server/src/realtime-state-provider.ts +1 -1
- package/realtime-server/src/realtime-state-receiver.ts +1 -1
- package/realtime-testing/dist/index.d.ts +2 -0
- package/realtime-testing/dist/index.js +57 -15
- package/realtime-testing/src/setup-realtime-test.tsx +66 -16
- package/src/atom.ts +2 -2
- package/src/dispose-state.ts +2 -2
- package/src/get-state.ts +9 -13
- package/src/molecule.ts +1 -1
- package/src/selector.ts +2 -2
- package/src/set-state.ts +10 -7
- package/src/silo.ts +29 -55
- package/src/subscribe.ts +3 -23
- package/src/timeline.ts +2 -2
- package/web/dist/index.d.ts +9 -0
- package/{dist/chunk-H6EDLPKH.js → web/dist/index.js} +5 -4
- package/web/package.json +13 -0
- package/web/src/index.ts +1 -0
- package/web/src/persist-sync.ts +25 -0
- package/dist/chunk-AK23DRMD.js +0 -21
- package/dist/chunk-IW6WYRS7.js +0 -140
- package/internal/src/families/throw-in-case-of-conflicting-family.ts +0 -18
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { createWritableSelectorFamily } from './chunk-BX3MTH2Z.js';
|
|
2
|
+
import { createStandaloneSelector, IMPLICIT, growMoleculeInStore, initFamilyMemberInStore, withdraw, seekInStore } from 'atom.io/internal';
|
|
3
|
+
|
|
4
|
+
// json/src/entries.ts
|
|
5
|
+
function fromEntries(entries) {
|
|
6
|
+
return Object.fromEntries(entries);
|
|
7
|
+
}
|
|
8
|
+
function toEntries(obj) {
|
|
9
|
+
return Object.entries(obj);
|
|
10
|
+
}
|
|
11
|
+
var selectJson = (atom, transform, store = IMPLICIT.STORE) => {
|
|
12
|
+
return createStandaloneSelector(store, {
|
|
13
|
+
key: `${atom.key}:JSON`,
|
|
14
|
+
get: ({ get }) => transform.toJson(get(atom)),
|
|
15
|
+
set: ({ set }, newValue) => {
|
|
16
|
+
set(atom, transform.fromJson(newValue));
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
function selectJsonFamily(atomFamilyToken, transform, store = IMPLICIT.STORE) {
|
|
21
|
+
const jsonFamily = createWritableSelectorFamily(
|
|
22
|
+
store,
|
|
23
|
+
{
|
|
24
|
+
key: `${atomFamilyToken.key}:JSON`,
|
|
25
|
+
get: (key) => ({ seek, get }) => {
|
|
26
|
+
const existingState = seek(atomFamilyToken, key);
|
|
27
|
+
if (existingState) {
|
|
28
|
+
return transform.toJson(get(existingState));
|
|
29
|
+
}
|
|
30
|
+
const stringKey = stringifyJson(key);
|
|
31
|
+
const molecule = store.molecules.get(stringKey);
|
|
32
|
+
if (molecule) {
|
|
33
|
+
const atom = growMoleculeInStore(molecule, atomFamilyToken, store);
|
|
34
|
+
return transform.toJson(get(atom));
|
|
35
|
+
}
|
|
36
|
+
if (store.config.lifespan === `immortal`) {
|
|
37
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
38
|
+
}
|
|
39
|
+
const newToken = initFamilyMemberInStore(store, atomFamilyToken, key);
|
|
40
|
+
return transform.toJson(get(newToken));
|
|
41
|
+
},
|
|
42
|
+
set: (key) => ({ seek, set }, newValue) => {
|
|
43
|
+
const existingState = seek(atomFamilyToken, key);
|
|
44
|
+
if (existingState) {
|
|
45
|
+
set(existingState, transform.fromJson(newValue));
|
|
46
|
+
} else {
|
|
47
|
+
const stringKey = stringifyJson(key);
|
|
48
|
+
const molecule = store.molecules.get(stringKey);
|
|
49
|
+
if (molecule) {
|
|
50
|
+
const atom = growMoleculeInStore(molecule, atomFamilyToken, store);
|
|
51
|
+
set(atom, transform.fromJson(newValue));
|
|
52
|
+
} else {
|
|
53
|
+
if (store.config.lifespan === `immortal`) {
|
|
54
|
+
throw new Error(`No molecule found for key "${stringKey}"`);
|
|
55
|
+
}
|
|
56
|
+
set(
|
|
57
|
+
initFamilyMemberInStore(store, atomFamilyToken, key),
|
|
58
|
+
transform.fromJson(newValue)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
[`mutable`, `json`]
|
|
65
|
+
);
|
|
66
|
+
const atomFamily = withdraw(atomFamilyToken, store);
|
|
67
|
+
atomFamily.subject.subscribe(
|
|
68
|
+
`store=${store.config.name}::json-selector-family`,
|
|
69
|
+
(event) => {
|
|
70
|
+
if (event.token.family) {
|
|
71
|
+
seekInStore(store, jsonFamily, parseJson(event.token.family.subKey));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
);
|
|
75
|
+
return jsonFamily;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// json/src/index.ts
|
|
79
|
+
var parseJson = (str) => JSON.parse(str);
|
|
80
|
+
var stringifyJson = (json) => JSON.stringify(json);
|
|
81
|
+
var JSON_PROTOTYPES = [Array, Boolean, Number, Object, String];
|
|
82
|
+
var isJson = (input) => {
|
|
83
|
+
if (input === null) return true;
|
|
84
|
+
if (input === void 0) return false;
|
|
85
|
+
const prototype = Object.getPrototypeOf(input);
|
|
86
|
+
return JSON_PROTOTYPES.includes(prototype);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export { fromEntries, isJson, parseJson, selectJson, selectJsonFamily, stringifyJson, toEntries };
|
package/dist/index.d.ts
CHANGED
|
@@ -341,6 +341,7 @@ declare class Silo {
|
|
|
341
341
|
redo: typeof redo;
|
|
342
342
|
moleculeFamily: typeof moleculeFamily;
|
|
343
343
|
makeMolecule: typeof makeMolecule;
|
|
344
|
+
runTransaction: typeof runTransaction;
|
|
344
345
|
constructor(config: Store[`config`], fromStore?: Store | null);
|
|
345
346
|
}
|
|
346
347
|
|
|
@@ -355,9 +356,9 @@ type KeyedStateUpdate<T> = Flat<StateUpdate<T> & {
|
|
|
355
356
|
}>;
|
|
356
357
|
type UpdateHandler<T> = (update: StateUpdate<T>) => void;
|
|
357
358
|
type TransactionUpdateHandler<F extends Func> = (data: TransactionUpdate<F>) => void;
|
|
358
|
-
declare function subscribe<T>(token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string
|
|
359
|
-
declare function subscribe<F extends Func>(token: TransactionToken<F>, handleUpdate: TransactionUpdateHandler<F>, key?: string
|
|
360
|
-
declare function subscribe<M extends TimelineManageable>(token: TimelineToken<M>, handleUpdate: (update: TimelineUpdate<M> | `redo` | `undo`) => void, key?: string
|
|
359
|
+
declare function subscribe<T>(token: ReadableToken<T>, handleUpdate: UpdateHandler<T>, key?: string): () => void;
|
|
360
|
+
declare function subscribe<F extends Func>(token: TransactionToken<F>, handleUpdate: TransactionUpdateHandler<F>, key?: string): () => void;
|
|
361
|
+
declare function subscribe<M extends TimelineManageable>(token: TimelineToken<M>, handleUpdate: (update: TimelineUpdate<M> | `redo` | `undo`) => void, key?: string): () => void;
|
|
361
362
|
|
|
362
363
|
type TimelineManageable = AtomFamilyToken<any, any> | AtomToken<any>;
|
|
363
364
|
type AtomOnly<M extends TimelineManageable> = M extends AtomFamilyToken<any, any> ? AtomToken<any> : M extends AtomToken<any> ? M : never;
|
package/dist/index.js
CHANGED
|
@@ -1,30 +1,26 @@
|
|
|
1
1
|
import './chunk-XWL6SNVU.js';
|
|
2
2
|
import * as Internal from 'atom.io/internal';
|
|
3
|
-
import { createStandaloneAtom, IMPLICIT, createAtomFamily, createMoleculeFamily, makeMoleculeInStore, Molecule, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, findInStore, getFromStore, setIntoStore, disposeFromStore,
|
|
3
|
+
import { createStandaloneAtom, IMPLICIT, createAtomFamily, createMoleculeFamily, makeMoleculeInStore, Molecule, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, findInStore, getFromStore, setIntoStore, disposeFromStore, subscribeInStore, timeTravel, actUponStore, arbitrary } from 'atom.io/internal';
|
|
4
4
|
import { stringifyJson } from 'atom.io/json';
|
|
5
5
|
|
|
6
6
|
function atom(options) {
|
|
7
|
-
return createStandaloneAtom(
|
|
7
|
+
return createStandaloneAtom(IMPLICIT.STORE, options);
|
|
8
8
|
}
|
|
9
9
|
function atomFamily(options) {
|
|
10
|
-
return createAtomFamily(
|
|
10
|
+
return createAtomFamily(IMPLICIT.STORE, options);
|
|
11
11
|
}
|
|
12
12
|
function disposeState(token, key) {
|
|
13
13
|
if (key) {
|
|
14
|
-
Internal.disposeFromStore(
|
|
14
|
+
Internal.disposeFromStore(Internal.IMPLICIT.STORE, token, key);
|
|
15
15
|
} else {
|
|
16
|
-
Internal.disposeFromStore(
|
|
16
|
+
Internal.disposeFromStore(Internal.IMPLICIT.STORE, token);
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
|
-
function getState(
|
|
20
|
-
if (
|
|
21
|
-
return Internal.getFromStore(
|
|
22
|
-
token,
|
|
23
|
-
key,
|
|
24
|
-
Internal.IMPLICIT.STORE
|
|
25
|
-
);
|
|
19
|
+
function getState(...params) {
|
|
20
|
+
if (params.length === 2) {
|
|
21
|
+
return Internal.getFromStore(Internal.IMPLICIT.STORE, ...params);
|
|
26
22
|
}
|
|
27
|
-
return Internal.getFromStore(
|
|
23
|
+
return Internal.getFromStore(Internal.IMPLICIT.STORE, ...params);
|
|
28
24
|
}
|
|
29
25
|
|
|
30
26
|
// src/logger.ts
|
|
@@ -63,7 +59,7 @@ var AtomIOLogger = class {
|
|
|
63
59
|
};
|
|
64
60
|
};
|
|
65
61
|
function moleculeFamily(options) {
|
|
66
|
-
return createMoleculeFamily(
|
|
62
|
+
return createMoleculeFamily(IMPLICIT.STORE, options);
|
|
67
63
|
}
|
|
68
64
|
function makeMolecule(context, family, key, ...params) {
|
|
69
65
|
return makeMoleculeInStore(IMPLICIT.STORE, context, family, key, ...params);
|
|
@@ -77,16 +73,16 @@ function makeRootMolecule(key, store = IMPLICIT.STORE) {
|
|
|
77
73
|
};
|
|
78
74
|
}
|
|
79
75
|
function selector(options) {
|
|
80
|
-
return createStandaloneSelector(
|
|
76
|
+
return createStandaloneSelector(IMPLICIT.STORE, options);
|
|
81
77
|
}
|
|
82
78
|
function selectorFamily(options) {
|
|
83
|
-
return createSelectorFamily(
|
|
79
|
+
return createSelectorFamily(IMPLICIT.STORE, options);
|
|
84
80
|
}
|
|
85
|
-
function setState(
|
|
86
|
-
if (
|
|
87
|
-
Internal.setIntoStore(
|
|
81
|
+
function setState(...params) {
|
|
82
|
+
if (params.length === 2) {
|
|
83
|
+
Internal.setIntoStore(Internal.IMPLICIT.STORE, ...params);
|
|
88
84
|
} else {
|
|
89
|
-
Internal.setIntoStore(
|
|
85
|
+
Internal.setIntoStore(Internal.IMPLICIT.STORE, ...params);
|
|
90
86
|
}
|
|
91
87
|
}
|
|
92
88
|
var Silo = class {
|
|
@@ -106,65 +102,51 @@ var Silo = class {
|
|
|
106
102
|
redo;
|
|
107
103
|
moleculeFamily;
|
|
108
104
|
makeMolecule;
|
|
105
|
+
runTransaction;
|
|
109
106
|
constructor(config, fromStore = null) {
|
|
110
107
|
const s = new Store(config, fromStore);
|
|
111
|
-
function _atom(options) {
|
|
112
|
-
return createStandaloneAtom(options, s);
|
|
113
|
-
}
|
|
114
|
-
function _atomFamily(options) {
|
|
115
|
-
return createAtomFamily(options, s);
|
|
116
|
-
}
|
|
117
108
|
this.store = s;
|
|
118
|
-
this.atom =
|
|
119
|
-
this.atomFamily =
|
|
120
|
-
this.selector = (options) => createStandaloneSelector(
|
|
121
|
-
this.selectorFamily = (options) => createSelectorFamily(
|
|
109
|
+
this.atom = (options) => createStandaloneAtom(s, options);
|
|
110
|
+
this.atomFamily = (options) => createAtomFamily(s, options);
|
|
111
|
+
this.selector = (options) => createStandaloneSelector(s, options);
|
|
112
|
+
this.selectorFamily = (options) => createSelectorFamily(s, options);
|
|
122
113
|
this.transaction = (options) => createTransaction(options, s);
|
|
123
114
|
this.timeline = (options) => createTimeline(options, s);
|
|
124
|
-
this.findState = (
|
|
125
|
-
this.getState = (...params) => getFromStore(...params
|
|
115
|
+
this.findState = (...params) => findInStore(s, ...params);
|
|
116
|
+
this.getState = (...params) => getFromStore(s, ...params);
|
|
126
117
|
this.setState = (...params) => {
|
|
127
|
-
setIntoStore(...params
|
|
118
|
+
setIntoStore(s, ...params);
|
|
128
119
|
};
|
|
129
120
|
this.disposeState = (...params) => {
|
|
130
|
-
disposeFromStore(...params
|
|
121
|
+
disposeFromStore(s, ...params);
|
|
131
122
|
};
|
|
132
|
-
this.subscribe = (
|
|
123
|
+
this.subscribe = (...params) => subscribeInStore(s, ...params);
|
|
133
124
|
this.undo = (token) => {
|
|
134
|
-
timeTravel(`undo`, token
|
|
125
|
+
timeTravel(s, `undo`, token);
|
|
135
126
|
};
|
|
136
127
|
this.redo = (token) => {
|
|
137
|
-
timeTravel(`redo`, token
|
|
128
|
+
timeTravel(s, `redo`, token);
|
|
138
129
|
};
|
|
139
|
-
this.moleculeFamily = (
|
|
140
|
-
return createMoleculeFamily(
|
|
130
|
+
this.moleculeFamily = (options) => {
|
|
131
|
+
return createMoleculeFamily(s, options);
|
|
141
132
|
};
|
|
142
133
|
this.makeMolecule = (...params) => {
|
|
143
134
|
return makeMoleculeInStore(s, ...params);
|
|
144
135
|
};
|
|
136
|
+
this.runTransaction = (token, id = arbitrary()) => actUponStore(token, id, s);
|
|
145
137
|
}
|
|
146
138
|
};
|
|
147
|
-
function subscribe(token, handleUpdate, key = arbitrary()
|
|
148
|
-
|
|
149
|
-
case `atom`:
|
|
150
|
-
case `mutable_atom`:
|
|
151
|
-
case `readonly_selector`:
|
|
152
|
-
case `selector`:
|
|
153
|
-
return subscribeToState(token, handleUpdate, key, store);
|
|
154
|
-
case `transaction`:
|
|
155
|
-
return subscribeToTransaction(token, handleUpdate, key, store);
|
|
156
|
-
case `timeline`:
|
|
157
|
-
return subscribeToTimeline(token, handleUpdate, key, store);
|
|
158
|
-
}
|
|
139
|
+
function subscribe(token, handleUpdate, key = arbitrary()) {
|
|
140
|
+
return subscribeInStore(IMPLICIT.STORE, token, handleUpdate, key);
|
|
159
141
|
}
|
|
160
142
|
var timeline = (options) => {
|
|
161
143
|
return createTimeline(options, IMPLICIT.STORE);
|
|
162
144
|
};
|
|
163
145
|
var redo = (tl) => {
|
|
164
|
-
timeTravel(`redo`, tl
|
|
146
|
+
timeTravel(IMPLICIT.STORE, `redo`, tl);
|
|
165
147
|
};
|
|
166
148
|
var undo = (tl) => {
|
|
167
|
-
timeTravel(`undo`, tl
|
|
149
|
+
timeTravel(IMPLICIT.STORE, `undo`, tl);
|
|
168
150
|
};
|
|
169
151
|
function transaction(options) {
|
|
170
152
|
return createTransaction(options, IMPLICIT.STORE);
|
package/ephemeral/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import '../../dist/chunk-XWL6SNVU.js';
|
|
|
2
2
|
import { findInStore, IMPLICIT } from 'atom.io/internal';
|
|
3
3
|
|
|
4
4
|
function findState(token, key) {
|
|
5
|
-
const state = findInStore(token, key
|
|
5
|
+
const state = findInStore(IMPLICIT.STORE, token, key);
|
|
6
6
|
return state;
|
|
7
7
|
}
|
|
8
8
|
|
package/immortal/dist/index.js
CHANGED
|
@@ -3,9 +3,9 @@ import { seekInStore, IMPLICIT } from 'atom.io/internal';
|
|
|
3
3
|
|
|
4
4
|
function seekState(token, key) {
|
|
5
5
|
if (token.type === `molecule_family`) {
|
|
6
|
-
return seekInStore(token, key
|
|
6
|
+
return seekInStore(IMPLICIT.STORE, token, key);
|
|
7
7
|
}
|
|
8
|
-
const state = seekInStore(token, key
|
|
8
|
+
const state = seekInStore(IMPLICIT.STORE, token, key);
|
|
9
9
|
return state;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -65,8 +65,8 @@ export function seekState(
|
|
|
65
65
|
key: Canonical,
|
|
66
66
|
): MoleculeToken<any> | ReadableToken<any> | undefined {
|
|
67
67
|
if (token.type === `molecule_family`) {
|
|
68
|
-
return seekInStore(token, key
|
|
68
|
+
return seekInStore(IMPLICIT.STORE, token, key)
|
|
69
69
|
}
|
|
70
|
-
const state = seekInStore(token, key
|
|
70
|
+
const state = seekInStore(IMPLICIT.STORE, token, key)
|
|
71
71
|
return state
|
|
72
72
|
}
|