atom.io 0.30.7 → 0.31.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/data/dist/index.d.ts +20 -18
- package/data/dist/index.js +104 -172
- package/data/src/join.ts +138 -210
- package/dist/{chunk-UDHCFTYT.js → chunk-Y5MBNTVU.js} +582 -762
- package/dist/index.d.ts +254 -173
- package/dist/index.js +91 -14
- package/ephemeral/dist/index.d.ts +35 -25
- package/ephemeral/src/find-state.ts +35 -25
- package/eslint-plugin/dist/index.d.ts +22 -3
- package/eslint-plugin/dist/index.js +7 -7
- package/immortal/dist/index.d.ts +1 -2
- package/immortal/dist/index.js +0 -3
- package/immortal/src/seek-state.ts +2 -14
- package/internal/dist/index.d.ts +57 -88
- package/internal/dist/index.js +1 -2
- package/internal/src/atom/dispose-atom.ts +31 -15
- package/internal/src/families/dispose-from-store.ts +15 -44
- package/internal/src/families/find-in-store.ts +9 -7
- package/internal/src/families/init-family-member.ts +1 -1
- package/internal/src/families/seek-in-store.ts +2 -14
- package/internal/src/get-state/get-from-store.ts +13 -79
- package/internal/src/get-trace.ts +7 -0
- package/internal/src/index.ts +17 -8
- package/internal/src/ingest-updates/ingest-creation-disposal.ts +65 -73
- package/internal/src/ingest-updates/ingest-transaction-update.ts +4 -0
- package/internal/src/install-into-store.ts +48 -0
- package/internal/src/junction.ts +52 -12
- package/internal/src/lineage.ts +0 -7
- package/internal/src/molecule.ts +306 -0
- package/internal/src/mutable/transceiver.ts +5 -5
- package/internal/src/not-found-error.ts +8 -30
- package/internal/src/pretty-print.ts +1 -16
- package/internal/src/selector/dispose-selector.ts +3 -5
- package/internal/src/selector/register-selector.ts +3 -34
- package/internal/src/set-state/set-into-store.ts +3 -2
- package/internal/src/store/counterfeit.ts +11 -25
- package/internal/src/store/deposit.ts +10 -42
- package/internal/src/store/store.ts +51 -12
- package/internal/src/store/withdraw.ts +18 -60
- package/internal/src/timeline/create-timeline.ts +133 -237
- package/internal/src/timeline/time-travel.ts +1 -8
- package/internal/src/transaction/build-transaction.ts +10 -5
- package/internal/src/transaction/index.ts +1 -1
- package/internal/src/utility-types.ts +2 -0
- package/introspection/dist/index.d.ts +2 -3
- package/introspection/dist/index.js +9 -9
- package/introspection/src/refinery.ts +1 -3
- package/json/dist/index.js +8 -40
- package/json/src/index.ts +2 -0
- package/json/src/select-json-family.ts +7 -44
- package/package.json +33 -28
- package/react/dist/index.js +2 -10
- package/react/src/parse-state-overloads.ts +3 -11
- package/react-devtools/dist/index.js +13 -13
- package/react-devtools/src/Updates.tsx +2 -0
- package/realtime-client/dist/index.d.ts +20 -12
- package/realtime-client/dist/index.js +241 -244
- package/realtime-client/src/continuity/index.ts +3 -0
- package/realtime-client/src/continuity/register-and-attempt-confirmed-update.ts +231 -0
- package/realtime-client/src/continuity/use-conceal-state.ts +11 -0
- package/realtime-client/src/continuity/use-reveal-state.ts +19 -0
- package/realtime-client/src/index.ts +1 -0
- package/realtime-client/src/sync-continuity.ts +18 -262
- package/realtime-react/dist/index.js +2 -2
- package/realtime-server/dist/index.d.ts +1 -1
- package/realtime-server/dist/index.js +2 -2
- package/realtime-server/src/index.ts +1 -1
- package/realtime-server/src/ipc-sockets/child-socket.ts +0 -1
- package/realtime-server/src/realtime-server-stores/server-room-external-actions.ts +1 -1
- package/realtime-testing/dist/index.js +5 -7
- package/realtime-testing/src/setup-realtime-test.tsx +5 -6
- package/src/atom.ts +53 -29
- package/src/dispose-state.ts +17 -23
- package/src/get-state.ts +19 -21
- package/src/index.ts +73 -3
- package/src/realm.ts +169 -0
- package/src/selector.ts +20 -0
- package/src/set-state.ts +16 -8
- package/src/silo.ts +9 -14
- package/src/timeline.ts +2 -3
- package/src/transaction.ts +25 -38
- package/transceivers/set-rtx/dist/index.js +4 -1
- package/transceivers/set-rtx/src/set-rtx.ts +4 -1
- package/dist/chunk-ADMEAXYU.js +0 -167
- package/internal/src/molecule/create-molecule-family.ts +0 -30
- package/internal/src/molecule/dispose-molecule.ts +0 -79
- package/internal/src/molecule/grow-molecule-in-store.ts +0 -95
- package/internal/src/molecule/index.ts +0 -5
- package/internal/src/molecule/make-molecule-in-store.ts +0 -191
- package/internal/src/molecule/molecule-internal.ts +0 -52
- package/src/allocate.ts +0 -277
- package/src/molecule.ts +0 -138
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { newest, isChildStore, withdraw } from './chunk-Y5MBNTVU.js';
|
|
2
2
|
import './chunk-XWL6SNVU.js';
|
|
3
3
|
import * as Internal from 'atom.io/internal';
|
|
4
|
-
import { createStandaloneAtom, IMPLICIT, createAtomFamily, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, findInStore, getFromStore, setIntoStore, disposeFromStore, subscribeInStore, timeTravel,
|
|
4
|
+
import { createStandaloneAtom, IMPLICIT, createAtomFamily, makeRootMoleculeInStore, allocateIntoStore, fuseWithinStore, deallocateFromStore, claimWithinStore, createStandaloneSelector, createSelectorFamily, Store, createTransaction, createTimeline, findInStore, getFromStore, setIntoStore, disposeFromStore, subscribeInStore, timeTravel, actUponStore, arbitrary } from 'atom.io/internal';
|
|
5
5
|
|
|
6
6
|
function atom(options) {
|
|
7
7
|
return createStandaloneAtom(IMPLICIT.STORE, options);
|
|
@@ -9,7 +9,7 @@ function atom(options) {
|
|
|
9
9
|
function atomFamily(options) {
|
|
10
10
|
return createAtomFamily(IMPLICIT.STORE, options);
|
|
11
11
|
}
|
|
12
|
-
function disposeState(token, key) {
|
|
12
|
+
function disposeState(...[token, key]) {
|
|
13
13
|
if (key) {
|
|
14
14
|
Internal.disposeFromStore(Internal.IMPLICIT.STORE, token, key);
|
|
15
15
|
} else {
|
|
@@ -58,6 +58,54 @@ var AtomIOLogger = class {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
|
+
var $claim = Symbol(`claim`);
|
|
62
|
+
var Realm = class {
|
|
63
|
+
store;
|
|
64
|
+
constructor(store = IMPLICIT.STORE) {
|
|
65
|
+
this.store = store;
|
|
66
|
+
makeRootMoleculeInStore(`root`, store);
|
|
67
|
+
}
|
|
68
|
+
allocate(provenance, key, attachmentStyle) {
|
|
69
|
+
return allocateIntoStore(
|
|
70
|
+
this.store,
|
|
71
|
+
provenance,
|
|
72
|
+
key,
|
|
73
|
+
attachmentStyle
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
fuse(type, reagentA, reagentB) {
|
|
77
|
+
return fuseWithinStore(this.store, type, reagentA, reagentB);
|
|
78
|
+
}
|
|
79
|
+
deallocate(claim) {
|
|
80
|
+
deallocateFromStore(this.store, claim);
|
|
81
|
+
}
|
|
82
|
+
claim(newProvenance, claim, exclusive) {
|
|
83
|
+
return claimWithinStore(this.store, newProvenance, claim, exclusive);
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
var Anarchy = class {
|
|
87
|
+
store;
|
|
88
|
+
realm;
|
|
89
|
+
constructor(store = IMPLICIT.STORE) {
|
|
90
|
+
this.store = store;
|
|
91
|
+
this.realm = new Realm(store);
|
|
92
|
+
}
|
|
93
|
+
allocate(provenance, key, attachmentStyle) {
|
|
94
|
+
allocateIntoStore(
|
|
95
|
+
this.store,
|
|
96
|
+
provenance,
|
|
97
|
+
key,
|
|
98
|
+
attachmentStyle
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
deallocate(key) {
|
|
102
|
+
deallocateFromStore(this.store, key);
|
|
103
|
+
}
|
|
104
|
+
claim(newProvenance, key, exclusive) {
|
|
105
|
+
claimWithinStore(this.store, newProvenance, key, exclusive);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
var T$ = `T$`;
|
|
61
109
|
function selector(options) {
|
|
62
110
|
return createStandaloneSelector(IMPLICIT.STORE, options);
|
|
63
111
|
}
|
|
@@ -71,6 +119,40 @@ function setState(...params) {
|
|
|
71
119
|
Internal.setIntoStore(Internal.IMPLICIT.STORE, ...params);
|
|
72
120
|
}
|
|
73
121
|
}
|
|
122
|
+
|
|
123
|
+
// internal/src/install-into-store.ts
|
|
124
|
+
function installIntoStore(tokens, target, source) {
|
|
125
|
+
const sourceNewest = newest(source);
|
|
126
|
+
if (isChildStore(sourceNewest)) {
|
|
127
|
+
source.logger.error(
|
|
128
|
+
`\u274C`,
|
|
129
|
+
`transaction`,
|
|
130
|
+
sourceNewest.transactionMeta.update.key,
|
|
131
|
+
`could not install the following tokens into store "${target.config.name} from "${source.config.name}":`,
|
|
132
|
+
tokens,
|
|
133
|
+
`${sourceNewest.config.name} is undergoing a transaction.`
|
|
134
|
+
);
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
const targetNewest = newest(target);
|
|
138
|
+
if (isChildStore(targetNewest)) {
|
|
139
|
+
target.logger.error(
|
|
140
|
+
`\u274C`,
|
|
141
|
+
`transaction`,
|
|
142
|
+
targetNewest.transactionMeta.update.key,
|
|
143
|
+
`could not install the following tokens into store "${target.config.name} from "${source.config.name}":`,
|
|
144
|
+
tokens,
|
|
145
|
+
`${targetNewest.config.name} is undergoing a transaction.`
|
|
146
|
+
);
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
for (const token of tokens) {
|
|
150
|
+
const resource = withdraw(token, source);
|
|
151
|
+
resource.install(target);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// src/silo.ts
|
|
74
156
|
var Silo = class {
|
|
75
157
|
store;
|
|
76
158
|
atom;
|
|
@@ -86,12 +168,10 @@ var Silo = class {
|
|
|
86
168
|
subscribe;
|
|
87
169
|
undo;
|
|
88
170
|
redo;
|
|
89
|
-
moleculeFamily;
|
|
90
|
-
makeMolecule;
|
|
91
171
|
runTransaction;
|
|
172
|
+
install;
|
|
92
173
|
constructor(config, fromStore = null) {
|
|
93
|
-
const s = new Store(config, fromStore);
|
|
94
|
-
this.store = s;
|
|
174
|
+
const s = this.store = new Store(config, fromStore);
|
|
95
175
|
this.atom = (options) => createStandaloneAtom(s, options);
|
|
96
176
|
this.atomFamily = (options) => createAtomFamily(s, options);
|
|
97
177
|
this.selector = (options) => createStandaloneSelector(s, options);
|
|
@@ -113,13 +193,10 @@ var Silo = class {
|
|
|
113
193
|
this.redo = (token) => {
|
|
114
194
|
timeTravel(s, `redo`, token);
|
|
115
195
|
};
|
|
116
|
-
this.moleculeFamily = (options) => {
|
|
117
|
-
return createMoleculeFamily(s, options);
|
|
118
|
-
};
|
|
119
|
-
this.makeMolecule = (...params) => {
|
|
120
|
-
return makeMoleculeInStore(s, ...params);
|
|
121
|
-
};
|
|
122
196
|
this.runTransaction = (token, id = arbitrary()) => actUponStore(token, id, s);
|
|
197
|
+
this.install = (tokens, source = IMPLICIT.STORE) => {
|
|
198
|
+
installIntoStore(tokens, s, source);
|
|
199
|
+
};
|
|
123
200
|
}
|
|
124
201
|
};
|
|
125
202
|
function subscribe(token, handleUpdate, key = arbitrary()) {
|
|
@@ -149,4 +226,4 @@ function belongsTo(family, unknownToken) {
|
|
|
149
226
|
return family.key === unknownToken.family?.key;
|
|
150
227
|
}
|
|
151
228
|
|
|
152
|
-
export { AtomIOLogger, LOG_LEVELS, Silo, atom, atomFamily, belongsTo, disposeState, getState, isToken, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };
|
|
229
|
+
export { $claim, Anarchy, AtomIOLogger, LOG_LEVELS, Realm, Silo, T$, atom, atomFamily, belongsTo, disposeState, getState, isToken, redo, runTransaction, selector, selectorFamily, setState, simpleLog, simpleLogger, subscribe, timeline, transaction, undo };
|
|
@@ -3,54 +3,64 @@ import { Transceiver } from 'atom.io/internal';
|
|
|
3
3
|
import { Json, Canonical } from 'atom.io/json';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* @
|
|
7
|
-
* Finds a {@link MutableAtomToken} in the store
|
|
8
|
-
* @param token - A {@link MutableAtomFamilyToken}
|
|
9
|
-
* @param key - The key of the state
|
|
6
|
+
* @public
|
|
7
|
+
* Finds a {@link MutableAtomToken} in the store
|
|
8
|
+
* @param token - A {@link MutableAtomFamilyToken}
|
|
9
|
+
* @param key - The key of the state
|
|
10
10
|
* @returns
|
|
11
|
-
* The current value of the state
|
|
11
|
+
* The current value of the state
|
|
12
|
+
* @overload Mutable Atom
|
|
12
13
|
*/
|
|
13
14
|
declare function findState<T extends Transceiver<any>, J extends Json.Serializable, K extends Canonical, Key extends K>(token: MutableAtomFamilyToken<T, J, K>, key: Key): MutableAtomToken<T, J, K>;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* @param
|
|
16
|
+
* @public
|
|
17
|
+
* Finds a state in the store
|
|
18
|
+
* @param token - The token of the state family
|
|
19
|
+
* @param key - The key of the state
|
|
18
20
|
* @returns
|
|
19
|
-
* The current value of the state
|
|
21
|
+
* The current value of the state
|
|
22
|
+
* @overload Regular Atom
|
|
20
23
|
*/
|
|
21
24
|
declare function findState<T, K extends Canonical, Key extends K>(token: RegularAtomFamilyToken<T, K>, key: Key): RegularAtomToken<T, K>;
|
|
22
25
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param
|
|
26
|
+
* @public
|
|
27
|
+
* Finds a state in the store
|
|
28
|
+
* @param token - The token of the state family
|
|
29
|
+
* @param key - The key of the state
|
|
26
30
|
* @returns
|
|
27
|
-
* The current value of the state
|
|
31
|
+
* The current value of the state
|
|
32
|
+
* @overload Writable Selector
|
|
28
33
|
*/
|
|
29
34
|
declare function findState<T, K extends Canonical, Key extends K>(token: WritableSelectorFamilyToken<T, K>, key: Key): WritableSelectorToken<T, K>;
|
|
30
35
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
* @param
|
|
36
|
+
* @public
|
|
37
|
+
* Finds a state in the store
|
|
38
|
+
* @param token - The token of the state family
|
|
39
|
+
* @param key - The key of the state
|
|
34
40
|
* @returns
|
|
35
|
-
* The current value of the state
|
|
41
|
+
* The current value of the state
|
|
42
|
+
* @overload Readonly Selector
|
|
36
43
|
*/
|
|
37
44
|
declare function findState<T, K extends Canonical, Key extends K>(token: ReadonlySelectorFamilyToken<T, K>, key: Key): ReadonlySelectorToken<T, K>;
|
|
38
45
|
/**
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* @param
|
|
46
|
+
* @public
|
|
47
|
+
* Finds a state in the store
|
|
48
|
+
* @param token - The token of the state family
|
|
49
|
+
* @param key - The key of the state
|
|
42
50
|
* @returns
|
|
43
|
-
* The current value of the state
|
|
51
|
+
* The current value of the state
|
|
52
|
+
* @overload Writable State
|
|
44
53
|
*/
|
|
45
54
|
declare function findState<T, K extends Canonical, Key extends K>(token: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K>;
|
|
46
55
|
/**
|
|
47
56
|
* @public
|
|
48
|
-
* Finds a {@link ReadableToken} in the store
|
|
49
|
-
* @param token - A {@link ReadableFamilyToken}
|
|
50
|
-
* @param key - The key of the state
|
|
57
|
+
* Finds a {@link ReadableToken} in the store
|
|
58
|
+
* @param token - A {@link ReadableFamilyToken}
|
|
59
|
+
* @param key - The key of the state
|
|
51
60
|
* @returns
|
|
52
|
-
* The current value of the state
|
|
61
|
+
* The current value of the state
|
|
53
62
|
* @overload Unknown
|
|
63
|
+
* @default
|
|
54
64
|
*/
|
|
55
65
|
declare function findState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K>;
|
|
56
66
|
|
|
@@ -17,12 +17,13 @@ import { findInStore, IMPLICIT } from "atom.io/internal"
|
|
|
17
17
|
import type { Canonical, Json } from "atom.io/json"
|
|
18
18
|
|
|
19
19
|
/**
|
|
20
|
-
* @
|
|
21
|
-
* Finds a {@link MutableAtomToken} in the store
|
|
22
|
-
* @param token - A {@link MutableAtomFamilyToken}
|
|
23
|
-
* @param key - The key of the state
|
|
20
|
+
* @public
|
|
21
|
+
* Finds a {@link MutableAtomToken} in the store
|
|
22
|
+
* @param token - A {@link MutableAtomFamilyToken}
|
|
23
|
+
* @param key - The key of the state
|
|
24
24
|
* @returns
|
|
25
|
-
* The current value of the state
|
|
25
|
+
* The current value of the state
|
|
26
|
+
* @overload Mutable Atom
|
|
26
27
|
*/
|
|
27
28
|
export function findState<
|
|
28
29
|
T extends Transceiver<any>,
|
|
@@ -31,44 +32,52 @@ export function findState<
|
|
|
31
32
|
Key extends K,
|
|
32
33
|
>(token: MutableAtomFamilyToken<T, J, K>, key: Key): MutableAtomToken<T, J, K>
|
|
33
34
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* @param
|
|
35
|
+
* @public
|
|
36
|
+
* Finds a state in the store
|
|
37
|
+
* @param token - The token of the state family
|
|
38
|
+
* @param key - The key of the state
|
|
37
39
|
* @returns
|
|
38
|
-
* The current value of the state
|
|
40
|
+
* The current value of the state
|
|
41
|
+
* @overload Regular Atom
|
|
39
42
|
*/
|
|
40
43
|
export function findState<T, K extends Canonical, Key extends K>(
|
|
41
44
|
token: RegularAtomFamilyToken<T, K>,
|
|
42
45
|
key: Key,
|
|
43
46
|
): RegularAtomToken<T, K>
|
|
44
47
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
* @param
|
|
48
|
+
* @public
|
|
49
|
+
* Finds a state in the store
|
|
50
|
+
* @param token - The token of the state family
|
|
51
|
+
* @param key - The key of the state
|
|
48
52
|
* @returns
|
|
49
|
-
* The current value of the state
|
|
53
|
+
* The current value of the state
|
|
54
|
+
* @overload Writable Selector
|
|
50
55
|
*/
|
|
51
56
|
export function findState<T, K extends Canonical, Key extends K>(
|
|
52
57
|
token: WritableSelectorFamilyToken<T, K>,
|
|
53
58
|
key: Key,
|
|
54
59
|
): WritableSelectorToken<T, K>
|
|
55
60
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
* @param
|
|
61
|
+
* @public
|
|
62
|
+
* Finds a state in the store
|
|
63
|
+
* @param token - The token of the state family
|
|
64
|
+
* @param key - The key of the state
|
|
59
65
|
* @returns
|
|
60
|
-
* The current value of the state
|
|
66
|
+
* The current value of the state
|
|
67
|
+
* @overload Readonly Selector
|
|
61
68
|
*/
|
|
62
69
|
export function findState<T, K extends Canonical, Key extends K>(
|
|
63
70
|
token: ReadonlySelectorFamilyToken<T, K>,
|
|
64
71
|
key: Key,
|
|
65
72
|
): ReadonlySelectorToken<T, K>
|
|
66
73
|
/**
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
* @param
|
|
74
|
+
* @public
|
|
75
|
+
* Finds a state in the store
|
|
76
|
+
* @param token - The token of the state family
|
|
77
|
+
* @param key - The key of the state
|
|
70
78
|
* @returns
|
|
71
|
-
* The current value of the state
|
|
79
|
+
* The current value of the state
|
|
80
|
+
* @overload Writable State
|
|
72
81
|
*/
|
|
73
82
|
export function findState<T, K extends Canonical, Key extends K>(
|
|
74
83
|
token: WritableFamilyToken<T, K>,
|
|
@@ -76,12 +85,13 @@ export function findState<T, K extends Canonical, Key extends K>(
|
|
|
76
85
|
): WritableToken<T, K>
|
|
77
86
|
/**
|
|
78
87
|
* @public
|
|
79
|
-
* Finds a {@link ReadableToken} in the store
|
|
80
|
-
* @param token - A {@link ReadableFamilyToken}
|
|
81
|
-
* @param key - The key of the state
|
|
88
|
+
* Finds a {@link ReadableToken} in the store
|
|
89
|
+
* @param token - A {@link ReadableFamilyToken}
|
|
90
|
+
* @param key - The key of the state
|
|
82
91
|
* @returns
|
|
83
|
-
* The current value of the state
|
|
92
|
+
* The current value of the state
|
|
84
93
|
* @overload Unknown
|
|
94
|
+
* @default
|
|
85
95
|
*/
|
|
86
96
|
export function findState<T, K extends Canonical, Key extends K>(
|
|
87
97
|
token: ReadableFamilyToken<T, K>,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as _eslint_core from '@eslint/core';
|
|
1
2
|
import * as ESTree from 'estree';
|
|
2
3
|
import * as eslint from 'eslint';
|
|
3
4
|
import { Rule } from 'eslint';
|
|
@@ -20,7 +21,13 @@ declare const lifespan: {
|
|
|
20
21
|
default: string;
|
|
21
22
|
}[];
|
|
22
23
|
};
|
|
23
|
-
create(context:
|
|
24
|
+
create(context: _eslint_core.RuleContext<{
|
|
25
|
+
LangOptions: eslint.Linter.LanguageOptions;
|
|
26
|
+
Code: eslint.SourceCode;
|
|
27
|
+
RuleOptions: any[];
|
|
28
|
+
Node: ESTree.Node;
|
|
29
|
+
MessageIds: string;
|
|
30
|
+
}>): {
|
|
24
31
|
ImportDeclaration(node: ESTree.ImportDeclaration & Rule.NodeParentExtension): void;
|
|
25
32
|
CallExpression(node: ESTree.CallExpression & Rule.NodeParentExtension): void;
|
|
26
33
|
};
|
|
@@ -37,7 +44,13 @@ declare const synchronousSelectorDependencies: {
|
|
|
37
44
|
};
|
|
38
45
|
schema: never[];
|
|
39
46
|
};
|
|
40
|
-
create(context:
|
|
47
|
+
create(context: _eslint_core.RuleContext<{
|
|
48
|
+
LangOptions: eslint.Linter.LanguageOptions;
|
|
49
|
+
Code: eslint.SourceCode;
|
|
50
|
+
RuleOptions: any[];
|
|
51
|
+
Node: ESTree.Node;
|
|
52
|
+
MessageIds: string;
|
|
53
|
+
}>): {
|
|
41
54
|
CallExpression(node: ESTree.CallExpression & Rule.NodeParentExtension): void;
|
|
42
55
|
};
|
|
43
56
|
};
|
|
@@ -64,7 +77,13 @@ declare const _default: {
|
|
|
64
77
|
};
|
|
65
78
|
schema: never[];
|
|
66
79
|
};
|
|
67
|
-
create(context:
|
|
80
|
+
create(context: _eslint_core.RuleContext<{
|
|
81
|
+
LangOptions: eslint.Linter.LanguageOptions;
|
|
82
|
+
Code: eslint.SourceCode;
|
|
83
|
+
RuleOptions: any[];
|
|
84
|
+
Node: ESTree.Node;
|
|
85
|
+
MessageIds: string;
|
|
86
|
+
}>): {
|
|
68
87
|
CallExpression(node: ESTree.CallExpression & eslint.Rule.NodeParentExtension): void;
|
|
69
88
|
};
|
|
70
89
|
};
|
|
@@ -172,10 +172,10 @@ var lifespan = {
|
|
|
172
172
|
if (storeLifespan === `ephemeral`) {
|
|
173
173
|
return;
|
|
174
174
|
}
|
|
175
|
-
const functionCallee = node.callee.type === `Identifier` ? node.callee :
|
|
176
|
-
const methodCallee = node.callee.type === `MemberExpression` && node.callee.property.type === `Identifier` ? node.callee.property :
|
|
175
|
+
const functionCallee = node.callee.type === `Identifier` ? node.callee : undefined;
|
|
176
|
+
const methodCallee = node.callee.type === `MemberExpression` && node.callee.property.type === `Identifier` ? node.callee.property : undefined;
|
|
177
177
|
const callee = functionCallee ?? methodCallee;
|
|
178
|
-
if (callee ===
|
|
178
|
+
if (callee === undefined) {
|
|
179
179
|
return;
|
|
180
180
|
}
|
|
181
181
|
if (callee.name === `findState`) {
|
|
@@ -247,7 +247,7 @@ var lifespan = {
|
|
|
247
247
|
}
|
|
248
248
|
for (const storeProcedure of storeProcedures) {
|
|
249
249
|
const transactorsParam = storeProcedure.params[0];
|
|
250
|
-
const nonDestructuredTransactorsName = transactorsParam && `name` in transactorsParam ? transactorsParam.name :
|
|
250
|
+
const nonDestructuredTransactorsName = transactorsParam && `name` in transactorsParam ? transactorsParam.name : undefined;
|
|
251
251
|
walk(storeProcedure.body, (n) => {
|
|
252
252
|
if (n.type === `CallExpression`) {
|
|
253
253
|
let willReport = false;
|
|
@@ -327,14 +327,14 @@ var synchronousSelectorDependencies = {
|
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
329
|
if (selectorComputation?.type === `FunctionExpression` || selectorComputation?.type === `ArrowFunctionExpression`) {
|
|
330
|
-
const nonDestructuredTransactorsName = selectorComputation.params[0] && `name` in selectorComputation.params[0] ? selectorComputation.params[0].name :
|
|
330
|
+
const nonDestructuredTransactorsName = selectorComputation.params[0] && `name` in selectorComputation.params[0] ? selectorComputation.params[0].name : undefined;
|
|
331
331
|
let awaited;
|
|
332
332
|
let awaitNode;
|
|
333
333
|
walk(selectorComputation, (n, depth) => {
|
|
334
334
|
if (typeof awaited === `number`) {
|
|
335
335
|
if (awaited > depth) {
|
|
336
|
-
awaited =
|
|
337
|
-
awaitNode =
|
|
336
|
+
awaited = undefined;
|
|
337
|
+
awaitNode = undefined;
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
switch (n.type) {
|
package/immortal/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MutableAtomFamilyToken, MutableAtomToken, RegularAtomFamilyToken, RegularAtomToken, WritableSelectorFamilyToken, WritableSelectorToken, ReadonlySelectorFamilyToken, ReadonlySelectorToken, WritableFamilyToken, WritableToken, ReadableFamilyToken, ReadableToken
|
|
1
|
+
import { MutableAtomFamilyToken, MutableAtomToken, RegularAtomFamilyToken, RegularAtomToken, WritableSelectorFamilyToken, WritableSelectorToken, ReadonlySelectorFamilyToken, ReadonlySelectorToken, WritableFamilyToken, WritableToken, ReadableFamilyToken, ReadableToken } from 'atom.io';
|
|
2
2
|
import { Transceiver } from 'atom.io/internal';
|
|
3
3
|
import { Json, Canonical } from 'atom.io/json';
|
|
4
4
|
|
|
@@ -8,6 +8,5 @@ declare function seekState<T, K extends Canonical, Key extends K>(token: Writabl
|
|
|
8
8
|
declare function seekState<T, K extends Canonical, Key extends K>(token: ReadonlySelectorFamilyToken<T, K>, key: Key): ReadonlySelectorToken<T, K> | undefined;
|
|
9
9
|
declare function seekState<T, K extends Canonical, Key extends K>(token: WritableFamilyToken<T, K>, key: Key): WritableToken<T, K> | undefined;
|
|
10
10
|
declare function seekState<T, K extends Canonical, Key extends K>(token: ReadableFamilyToken<T, K>, key: Key): ReadableToken<T, K> | undefined;
|
|
11
|
-
declare function seekState<M extends MoleculeConstructor>(token: MoleculeFamilyToken<M>, key: MoleculeKey<M>): MoleculeToken<M> | undefined;
|
|
12
11
|
|
|
13
12
|
export { seekState };
|
package/immortal/dist/index.js
CHANGED
|
@@ -2,9 +2,6 @@ import '../../dist/chunk-XWL6SNVU.js';
|
|
|
2
2
|
import { seekInStore, IMPLICIT } from 'atom.io/internal';
|
|
3
3
|
|
|
4
4
|
function seekState(token, key) {
|
|
5
|
-
if (token.type === `molecule_family`) {
|
|
6
|
-
return seekInStore(IMPLICIT.STORE, token, key);
|
|
7
|
-
}
|
|
8
5
|
const state = seekInStore(IMPLICIT.STORE, token, key);
|
|
9
6
|
return state;
|
|
10
7
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
MoleculeConstructor,
|
|
3
|
-
MoleculeFamilyToken,
|
|
4
|
-
MoleculeKey,
|
|
5
|
-
MoleculeToken,
|
|
6
2
|
MutableAtomFamilyToken,
|
|
7
3
|
MutableAtomToken,
|
|
8
4
|
ReadableFamilyToken,
|
|
@@ -55,18 +51,10 @@ export function seekState<T, K extends Canonical, Key extends K>(
|
|
|
55
51
|
key: Key,
|
|
56
52
|
): ReadableToken<T, K> | undefined
|
|
57
53
|
|
|
58
|
-
export function seekState<M extends MoleculeConstructor>(
|
|
59
|
-
token: MoleculeFamilyToken<M>,
|
|
60
|
-
key: MoleculeKey<M>,
|
|
61
|
-
): MoleculeToken<M> | undefined
|
|
62
|
-
|
|
63
54
|
export function seekState(
|
|
64
|
-
token:
|
|
55
|
+
token: ReadableFamilyToken<any, any>,
|
|
65
56
|
key: Canonical,
|
|
66
|
-
):
|
|
67
|
-
if (token.type === `molecule_family`) {
|
|
68
|
-
return seekInStore(IMPLICIT.STORE, token, key)
|
|
69
|
-
}
|
|
57
|
+
): ReadableToken<any> | undefined {
|
|
70
58
|
const state = seekInStore(IMPLICIT.STORE, token, key)
|
|
71
59
|
return state
|
|
72
60
|
}
|