atom.io 0.27.5 → 0.28.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 +31 -29
- package/data/dist/index.js +16 -17
- package/data/src/join.ts +17 -19
- package/dist/{chunk-6ABWLAGY.js → chunk-6WL4RQMQ.js} +314 -249
- package/dist/chunk-D52JNVER.js +721 -0
- package/dist/chunk-YQ46F5O2.js +95 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +3 -1
- package/internal/dist/index.d.ts +72 -36
- package/internal/dist/index.js +1 -1
- package/internal/src/atom/dispose-atom.ts +2 -9
- package/internal/src/families/dispose-from-store.ts +29 -18
- package/internal/src/families/find-in-store.ts +17 -7
- package/internal/src/get-state/get-from-store.ts +41 -32
- package/internal/src/ingest-updates/ingest-creation-disposal.ts +10 -1
- package/internal/src/molecule/dispose-molecule.ts +6 -17
- package/internal/src/pretty-print.ts +1 -16
- package/internal/src/selector/dispose-selector.ts +2 -9
- package/internal/src/set-state/set-into-store.ts +17 -19
- package/internal/src/store/circular-buffer.ts +34 -0
- package/internal/src/store/counterfeit.ts +109 -0
- package/internal/src/store/deposit.ts +14 -0
- package/internal/src/store/index.ts +1 -0
- package/internal/src/store/store.ts +3 -0
- package/internal/src/store/withdraw.ts +15 -10
- package/internal/src/transaction/build-transaction.ts +1 -0
- package/introspection/dist/index.d.ts +84 -4
- package/introspection/dist/index.js +1 -392
- package/introspection/src/attach-introspection-states.ts +7 -4
- 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 -77
- package/json/src/entries.ts +6 -0
- package/json/src/index.ts +53 -6
- package/package.json +18 -9
- 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 +10 -27
- package/react-devtools/src/TimelineIndex.tsx +3 -3
- package/react-devtools/src/TransactionIndex.tsx +6 -6
- package/react-devtools/src/Updates.tsx +2 -3
- 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 +30 -37
- package/realtime-client/dist/index.js +24 -10
- package/realtime-client/src/pull-atom-family-member.ts +2 -0
- package/realtime-client/src/pull-mutable-atom-family-member.ts +2 -0
- package/realtime-client/src/pull-selector-family-member.ts +2 -0
- package/realtime-client/src/realtime-client-stores/client-main-store.ts +6 -6
- package/realtime-client/src/sync-continuity.ts +28 -6
- package/realtime-server/dist/index.js +41 -5
- package/realtime-server/src/ipc-sockets/child-socket.ts +2 -0
- package/realtime-server/src/realtime-continuity-synchronizer.ts +42 -78
- package/realtime-testing/dist/index.d.ts +2 -0
- package/realtime-testing/dist/index.js +50 -8
- package/realtime-testing/src/setup-realtime-test.tsx +61 -9
- package/src/logger.ts +1 -0
- package/src/silo.ts +7 -3
- package/transceivers/set-rtx/src/set-rtx.ts +1 -0
- 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/data/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as AtomIO from 'atom.io';
|
|
2
2
|
import { ReadonlySelectorFamilyToken, MutableAtomFamilyToken, SetterToolkit, disposeState, ReadonlySelectorToken } from 'atom.io';
|
|
3
3
|
import { Store, Molecule } from 'atom.io/internal';
|
|
4
|
-
import { Canonical, stringified, Json } from 'atom.io/json';
|
|
4
|
+
import { Canonical, stringified, Json as Json$1 } from 'atom.io/json';
|
|
5
5
|
import { findState } from 'atom.io/ephemeral';
|
|
6
6
|
import { SetRTX, SetRTXJson } from 'atom.io/transceivers/set-rtx';
|
|
7
7
|
|
|
@@ -10,20 +10,22 @@ declare function dict<State, Key extends Canonical>(family: AtomIO.ReadonlySelec
|
|
|
10
10
|
}>;
|
|
11
11
|
|
|
12
12
|
type primitive = boolean | number | string | null;
|
|
13
|
-
|
|
14
|
-
type Serializable = primitive | Readonly<{
|
|
15
|
-
|
|
16
|
-
}> | ReadonlyArray<Serializable>;
|
|
17
|
-
type Object
|
|
13
|
+
declare namespace Json {
|
|
14
|
+
type Serializable = primitive | Readonly<{
|
|
15
|
+
[key: string]: Serializable;
|
|
16
|
+
}> | ReadonlyArray<Serializable>;
|
|
17
|
+
type Object<Key extends string = string, Value extends Serializable = Serializable> = Record<Key, Value>;
|
|
18
|
+
type Array<Element extends Serializable = Serializable> = ReadonlyArray<Element>;
|
|
19
|
+
}
|
|
18
20
|
|
|
19
21
|
type Refinement<Unrefined, Refined extends Unrefined> = (value: Unrefined) => value is Refined;
|
|
20
22
|
type Cardinality = `1:1` | `1:n` | `n:n`;
|
|
21
23
|
|
|
22
|
-
interface JunctionEntries<Content extends Object
|
|
24
|
+
interface JunctionEntries<Content extends Json.Object | null> extends Json.Object {
|
|
23
25
|
readonly relations: [string, string[]][];
|
|
24
26
|
readonly contents: [string, Content][];
|
|
25
27
|
}
|
|
26
|
-
interface JunctionSchema<ASide extends string, BSide extends string> extends Object
|
|
28
|
+
interface JunctionSchema<ASide extends string, BSide extends string> extends Json.Object {
|
|
27
29
|
readonly between: [a: ASide, b: BSide];
|
|
28
30
|
readonly cardinality: Cardinality;
|
|
29
31
|
}
|
|
@@ -35,7 +37,7 @@ type BaseExternalStoreConfiguration = {
|
|
|
35
37
|
getRelatedKeys: (key: string) => Set<string> | undefined;
|
|
36
38
|
has: (a: string, b?: string) => boolean;
|
|
37
39
|
};
|
|
38
|
-
type ExternalStoreWithContentConfiguration<Content extends Object
|
|
40
|
+
type ExternalStoreWithContentConfiguration<Content extends Json.Object> = {
|
|
39
41
|
getContent: (contentKey: string) => Content | undefined;
|
|
40
42
|
setContent: (contentKey: string, content: Content) => void;
|
|
41
43
|
deleteContent: (contentKey: string) => void;
|
|
@@ -43,14 +45,14 @@ type ExternalStoreWithContentConfiguration<Content extends Object$1> = {
|
|
|
43
45
|
type Empty<Obj extends object> = {
|
|
44
46
|
[Key in keyof Obj]?: undefined;
|
|
45
47
|
};
|
|
46
|
-
type ExternalStoreConfiguration<Content extends Object
|
|
47
|
-
type JunctionAdvancedConfiguration<Content extends Object
|
|
48
|
+
type ExternalStoreConfiguration<Content extends Json.Object | null> = Content extends Json.Object ? BaseExternalStoreConfiguration & ExternalStoreWithContentConfiguration<Content> : BaseExternalStoreConfiguration & Empty<ExternalStoreWithContentConfiguration<Json.Object>>;
|
|
49
|
+
type JunctionAdvancedConfiguration<Content extends Json.Object | null> = {
|
|
48
50
|
externalStore?: ExternalStoreConfiguration<Content>;
|
|
49
51
|
isContent?: Refinement<unknown, Content>;
|
|
50
52
|
makeContentKey?: (a: string, b: string) => string;
|
|
51
53
|
};
|
|
52
|
-
type JunctionJSON<ASide extends string, BSide extends string, Content extends Object
|
|
53
|
-
declare class Junction<const ASide extends string, const BSide extends string, const Content extends Object
|
|
54
|
+
type JunctionJSON<ASide extends string, BSide extends string, Content extends Json.Object | null> = JunctionEntries<Content> & JunctionSchema<ASide, BSide>;
|
|
55
|
+
declare class Junction<const ASide extends string, const BSide extends string, const Content extends Json.Object | null = null> {
|
|
54
56
|
readonly a: ASide;
|
|
55
57
|
readonly b: BSide;
|
|
56
58
|
readonly cardinality: Cardinality;
|
|
@@ -83,18 +85,18 @@ declare class Junction<const ASide extends string, const BSide extends string, c
|
|
|
83
85
|
has(a: string, b?: string): boolean;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
|
-
interface JoinOptions<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json.Object | null> extends Json.Object, JunctionSchema<ASide, BSide>, Partial<JunctionEntries<Content>> {
|
|
88
|
+
interface JoinOptions<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json$1.Object | null> extends Json$1.Object, JunctionSchema<ASide, BSide>, Partial<JunctionEntries<Content>> {
|
|
87
89
|
readonly key: string;
|
|
88
90
|
readonly cardinality: Cardinality;
|
|
89
91
|
}
|
|
90
|
-
type JoinStateFamilies<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json.Object | null> = Cardinality extends `1:1` ? (Content extends Json.Object ? {
|
|
92
|
+
type JoinStateFamilies<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json$1.Object | null> = Cardinality extends `1:1` ? (Content extends Json$1.Object ? {
|
|
91
93
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntryOf${Capitalize<BSide>}` : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
|
|
92
94
|
string,
|
|
93
95
|
Content
|
|
94
96
|
] | null, string>;
|
|
95
97
|
} : {}) & {
|
|
96
98
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeyOf${Capitalize<BSide>}` : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string | null, string>;
|
|
97
|
-
} : Cardinality extends `1:n` ? (Content extends Json.Object ? {
|
|
99
|
+
} : Cardinality extends `1:n` ? (Content extends Json$1.Object ? {
|
|
98
100
|
readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<[
|
|
99
101
|
string,
|
|
100
102
|
Content
|
|
@@ -108,7 +110,7 @@ type JoinStateFamilies<ASide extends string, BSide extends string, Cardinality e
|
|
|
108
110
|
readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorFamilyToken<string | null, string>;
|
|
109
111
|
} & {
|
|
110
112
|
readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string[], string>;
|
|
111
|
-
} : Cardinality extends `n:n` ? (Content extends Json.Object ? {
|
|
113
|
+
} : Cardinality extends `n:n` ? (Content extends Json$1.Object ? {
|
|
112
114
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntriesOf${Capitalize<BSide>}` : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<[
|
|
113
115
|
string,
|
|
114
116
|
Content
|
|
@@ -116,7 +118,7 @@ type JoinStateFamilies<ASide extends string, BSide extends string, Cardinality e
|
|
|
116
118
|
} : {}) & {
|
|
117
119
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeysOf${Capitalize<BSide>}` : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorFamilyToken<string[], string>;
|
|
118
120
|
} : never;
|
|
119
|
-
declare class Join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json.Object | null = null> {
|
|
121
|
+
declare class Join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json$1.Object | null = null> {
|
|
120
122
|
private options;
|
|
121
123
|
private defaultContent;
|
|
122
124
|
private toolkit;
|
|
@@ -136,7 +138,7 @@ declare class Join<const ASide extends string, const BSide extends string, const
|
|
|
136
138
|
in(store: Store): Join<ASide, BSide, Cardinality, Content>;
|
|
137
139
|
constructor(options: JoinOptions<ASide, BSide, Cardinality, Content>, defaultContent: Content | undefined, store?: Store);
|
|
138
140
|
}
|
|
139
|
-
type JoinToken<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null = null> = {
|
|
141
|
+
type JoinToken<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null = null> = {
|
|
140
142
|
key: string;
|
|
141
143
|
type: `join`;
|
|
142
144
|
cardinality: Cardinality;
|
|
@@ -145,19 +147,19 @@ type JoinToken<ASide extends string, BSide extends string, Cardinality extends `
|
|
|
145
147
|
__content?: Content;
|
|
146
148
|
};
|
|
147
149
|
declare function join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`>(options: JoinOptions<ASide, BSide, Cardinality, null>, defaultContent?: undefined, store?: Store): JoinToken<ASide, BSide, Cardinality, null>;
|
|
148
|
-
declare function join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json.Object>(options: JoinOptions<ASide, BSide, Cardinality, Content>, defaultContent: Content, store?: Store): JoinToken<ASide, BSide, Cardinality, Content>;
|
|
150
|
+
declare function join<const ASide extends string, const BSide extends string, const Cardinality extends `1:1` | `1:n` | `n:n`, const Content extends Json$1.Object>(options: JoinOptions<ASide, BSide, Cardinality, Content>, defaultContent: Content, store?: Store): JoinToken<ASide, BSide, Cardinality, Content>;
|
|
149
151
|
declare function getJoinMap(store: Store & {
|
|
150
152
|
joins?: Map<string, Join<any, any, any, any>>;
|
|
151
153
|
}): Map<string, Join<any, any, any, any>>;
|
|
152
|
-
declare function getJoin<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, store: Store): Join<ASide, BSide, Cardinality, Content>;
|
|
153
|
-
type JoinStates<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json.Object | null> = Cardinality extends `1:1` ? (Content extends Json.Object ? {
|
|
154
|
+
declare function getJoin<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, store: Store): Join<ASide, BSide, Cardinality, Content>;
|
|
155
|
+
type JoinStates<ASide extends string, BSide extends string, Cardinality extends Cardinality, Content extends Json$1.Object | null> = Cardinality extends `1:1` ? (Content extends Json$1.Object ? {
|
|
154
156
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntryOf${Capitalize<BSide>}` : `${AB}EntryOf${Capitalize<ASide>}`]: ReadonlySelectorToken<[
|
|
155
157
|
string,
|
|
156
158
|
Content
|
|
157
159
|
] | null>;
|
|
158
160
|
} : {}) & {
|
|
159
161
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeyOf${Capitalize<BSide>}` : `${AB}KeyOf${Capitalize<ASide>}`]: ReadonlySelectorToken<string | null>;
|
|
160
|
-
} : Cardinality extends `1:n` ? (Content extends Json.Object ? {
|
|
162
|
+
} : Cardinality extends `1:n` ? (Content extends Json$1.Object ? {
|
|
161
163
|
readonly [A in ASide as `${A}EntryOf${Capitalize<BSide>}`]: ReadonlySelectorToken<[
|
|
162
164
|
string,
|
|
163
165
|
Content
|
|
@@ -171,7 +173,7 @@ type JoinStates<ASide extends string, BSide extends string, Cardinality extends
|
|
|
171
173
|
readonly [A in ASide as `${A}KeyOf${Capitalize<BSide>}`]: ReadonlySelectorToken<string | null>;
|
|
172
174
|
} & {
|
|
173
175
|
readonly [B in BSide as `${B}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorToken<string[]>;
|
|
174
|
-
} : Cardinality extends `n:n` ? (Content extends Json.Object ? {
|
|
176
|
+
} : Cardinality extends `n:n` ? (Content extends Json$1.Object ? {
|
|
175
177
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}EntriesOf${Capitalize<BSide>}` : `${AB}EntriesOf${Capitalize<ASide>}`]: ReadonlySelectorToken<[
|
|
176
178
|
string,
|
|
177
179
|
Content
|
|
@@ -179,12 +181,12 @@ type JoinStates<ASide extends string, BSide extends string, Cardinality extends
|
|
|
179
181
|
} : {}) & {
|
|
180
182
|
readonly [AB in ASide | BSide as AB extends ASide ? `${AB}KeysOf${Capitalize<BSide>}` : `${AB}KeysOf${Capitalize<ASide>}`]: ReadonlySelectorToken<string[]>;
|
|
181
183
|
} : never;
|
|
182
|
-
declare function findRelationsInStore<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, key: string, store: Store): JoinStates<ASide, BSide, Cardinality, Content>;
|
|
183
|
-
declare function findRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, key: string): JoinStates<ASide, BSide, Cardinality, Content>;
|
|
184
|
-
declare function editRelationsInStore<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, change: (relations: Junction<ASide, BSide, Content>) => void, store: Store): void;
|
|
185
|
-
declare function editRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, change: (relations: Junction<ASide, BSide, Content>) => void): void;
|
|
184
|
+
declare function findRelationsInStore<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, key: string, store: Store): JoinStates<ASide, BSide, Cardinality, Content>;
|
|
185
|
+
declare function findRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, key: string): JoinStates<ASide, BSide, Cardinality, Content>;
|
|
186
|
+
declare function editRelationsInStore<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, change: (relations: Junction<ASide, BSide, Content>) => void, store: Store): void;
|
|
187
|
+
declare function editRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>, change: (relations: Junction<ASide, BSide, Content>) => void): void;
|
|
186
188
|
declare function getInternalRelationsFromStore(token: JoinToken<any, any, any, any>, store: Store): MutableAtomFamilyToken<SetRTX<string>, SetRTXJson<string>, string>;
|
|
187
|
-
declare function getInternalRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>): MutableAtomFamilyToken<SetRTX<string>, SetRTXJson<string>, string>;
|
|
189
|
+
declare function getInternalRelations<ASide extends string, BSide extends string, Cardinality extends `1:1` | `1:n` | `n:n`, Content extends Json$1.Object | null>(token: JoinToken<ASide, BSide, Cardinality, Content>): MutableAtomFamilyToken<SetRTX<string>, SetRTXJson<string>, string>;
|
|
188
190
|
|
|
189
191
|
declare function struct<Struct extends {
|
|
190
192
|
[key: string]: unknown;
|
package/data/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Junction } from '../../dist/chunk-IBTHB2PI.js';
|
|
2
2
|
import '../../dist/chunk-XWL6SNVU.js';
|
|
3
|
-
import { createStandaloneSelector, findInStore, IMPLICIT,
|
|
3
|
+
import { createStandaloneSelector, findInStore, IMPLICIT, withdraw, growMoleculeInStore, NotFoundError, initFamilyMemberInStore, getFromStore, setIntoStore, seekInStore, getJsonToken, disposeFromStore, createMutableAtomFamily, createRegularAtomFamily, createMoleculeFamily, newest, makeMoleculeInStore, isChildStore, createRegularAtom, createSelectorFamily, createReadonlySelectorFamily, getJsonFamily } from 'atom.io/internal';
|
|
4
4
|
import { stringifyJson } from 'atom.io/json';
|
|
5
5
|
import { SetRTX } from 'atom.io/transceivers/set-rtx';
|
|
6
6
|
|
|
@@ -57,18 +57,6 @@ var Join = class _Join {
|
|
|
57
57
|
this.alternates = /* @__PURE__ */ new Map();
|
|
58
58
|
this.alternates.set(store.config.name, this);
|
|
59
59
|
this.store.miscResources.set(`join:${options.key}`, this);
|
|
60
|
-
this.toolkit = {
|
|
61
|
-
get: (...ps) => getFromStore(store, ...ps),
|
|
62
|
-
set: (...ps) => {
|
|
63
|
-
setIntoStore(store, ...ps);
|
|
64
|
-
},
|
|
65
|
-
find: (...ps) => findInStore(store, ...ps),
|
|
66
|
-
seek: (...ps) => seekInStore(store, ...ps),
|
|
67
|
-
json: (token) => getJsonToken(store, token),
|
|
68
|
-
dispose: (...ps) => {
|
|
69
|
-
disposeFromStore(store, ...ps);
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
60
|
this.retrieve = (token, key) => {
|
|
73
61
|
const maybeToken = this.toolkit.seek(token, key);
|
|
74
62
|
if (maybeToken) {
|
|
@@ -84,6 +72,18 @@ var Join = class _Join {
|
|
|
84
72
|
}
|
|
85
73
|
return initFamilyMemberInStore(store, token, key);
|
|
86
74
|
};
|
|
75
|
+
this.toolkit = {
|
|
76
|
+
get: (...ps) => getFromStore(store, ...ps),
|
|
77
|
+
set: (...ps) => {
|
|
78
|
+
setIntoStore(store, ...ps);
|
|
79
|
+
},
|
|
80
|
+
find: this.retrieve,
|
|
81
|
+
seek: (...ps) => seekInStore(store, ...ps),
|
|
82
|
+
json: (token) => getJsonToken(store, token),
|
|
83
|
+
dispose: (...ps) => {
|
|
84
|
+
disposeFromStore(store, ...ps);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
87
|
const aSide = options.between[0];
|
|
88
88
|
const bSide = options.between[1];
|
|
89
89
|
const relatedKeysAtoms = createMutableAtomFamily(
|
|
@@ -232,19 +232,18 @@ var Join = class _Join {
|
|
|
232
232
|
},
|
|
233
233
|
[`join`, `content`]
|
|
234
234
|
);
|
|
235
|
-
|
|
235
|
+
({
|
|
236
236
|
key: options.key,
|
|
237
237
|
type: `join`,
|
|
238
238
|
a: options.between[0],
|
|
239
239
|
b: options.between[1],
|
|
240
240
|
cardinality: options.cardinality
|
|
241
|
-
};
|
|
241
|
+
});
|
|
242
242
|
contentMolecules = createMoleculeFamily(store, {
|
|
243
243
|
key: `${options.key}/content-molecules`,
|
|
244
244
|
new: class ContentMolecule {
|
|
245
|
-
constructor(
|
|
245
|
+
constructor(_, key) {
|
|
246
246
|
this.key = key;
|
|
247
|
-
toolkit.bond(joinToken, { as: null });
|
|
248
247
|
}
|
|
249
248
|
}
|
|
250
249
|
});
|
package/data/src/join.ts
CHANGED
|
@@ -195,21 +195,6 @@ export class Join<
|
|
|
195
195
|
|
|
196
196
|
this.store.miscResources.set(`join:${options.key}`, this)
|
|
197
197
|
|
|
198
|
-
this.toolkit = {
|
|
199
|
-
get: ((...ps: Parameters<typeof getState>) =>
|
|
200
|
-
getFromStore(store, ...ps)) as typeof getState,
|
|
201
|
-
set: ((...ps: Parameters<typeof setState>) => {
|
|
202
|
-
setIntoStore(store, ...ps)
|
|
203
|
-
}) as typeof setState,
|
|
204
|
-
find: ((...ps: Parameters<typeof findState>) =>
|
|
205
|
-
findInStore(store, ...ps)) as typeof findState,
|
|
206
|
-
seek: ((...ps: Parameters<typeof seekState>) =>
|
|
207
|
-
seekInStore(store, ...ps)) as typeof seekState,
|
|
208
|
-
json: (token) => getJsonToken(store, token),
|
|
209
|
-
dispose: ((...ps: Parameters<typeof disposeState>) => {
|
|
210
|
-
disposeFromStore(store, ...ps)
|
|
211
|
-
}) as typeof disposeState,
|
|
212
|
-
}
|
|
213
198
|
this.retrieve = ((
|
|
214
199
|
token: ReadableFamilyToken<any, any>,
|
|
215
200
|
key: Json.Serializable,
|
|
@@ -228,6 +213,21 @@ export class Join<
|
|
|
228
213
|
}
|
|
229
214
|
return initFamilyMemberInStore(store, token, key)
|
|
230
215
|
}) as typeof findState
|
|
216
|
+
this.toolkit = {
|
|
217
|
+
get: ((...ps: Parameters<typeof getState>) =>
|
|
218
|
+
getFromStore(store, ...ps)) as typeof getState,
|
|
219
|
+
set: ((...ps: Parameters<typeof setState>) => {
|
|
220
|
+
setIntoStore(store, ...ps)
|
|
221
|
+
}) as typeof setState,
|
|
222
|
+
find: this.retrieve,
|
|
223
|
+
seek: ((...ps: Parameters<typeof seekState>) =>
|
|
224
|
+
seekInStore(store, ...ps)) as typeof seekState,
|
|
225
|
+
json: (token) => getJsonToken(store, token),
|
|
226
|
+
dispose: ((...ps: Parameters<typeof disposeState>) => {
|
|
227
|
+
disposeFromStore(store, ...ps)
|
|
228
|
+
}) as typeof disposeState,
|
|
229
|
+
}
|
|
230
|
+
|
|
231
231
|
const aSide: ASide = options.between[0]
|
|
232
232
|
const bSide: BSide = options.between[1]
|
|
233
233
|
const relatedKeysAtoms = createMutableAtomFamily<
|
|
@@ -416,11 +416,9 @@ export class Join<
|
|
|
416
416
|
key: `${options.key}/content-molecules`,
|
|
417
417
|
new: class ContentMolecule {
|
|
418
418
|
public constructor(
|
|
419
|
-
|
|
419
|
+
_: CtorToolkit<string>,
|
|
420
420
|
public key: string,
|
|
421
|
-
) {
|
|
422
|
-
toolkit.bond(joinToken, { as: null } as any)
|
|
423
|
-
}
|
|
421
|
+
) {}
|
|
424
422
|
},
|
|
425
423
|
})
|
|
426
424
|
const getContent: Read<(key: string) => Content | null> = ({ get }, key) =>
|