atom.io 0.25.4 → 0.25.5
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/index.cjs +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/internal/dist/index.cjs +10 -1
- package/internal/dist/index.js +10 -1
- package/internal/src/selector/register-selector.ts +10 -1
- package/package.json +6 -6
- package/src/silo.ts +12 -0
package/dist/index.cjs
CHANGED
|
@@ -144,6 +144,12 @@ var Silo = class {
|
|
|
144
144
|
this.redo = (token) => {
|
|
145
145
|
Internal.timeTravel(`redo`, token, s);
|
|
146
146
|
};
|
|
147
|
+
this.moleculeFamily = (...params) => {
|
|
148
|
+
return Internal.createMoleculeFamily(...params, s);
|
|
149
|
+
};
|
|
150
|
+
this.makeMolecule = (...params) => {
|
|
151
|
+
return Internal.makeMoleculeInStore(s, ...params);
|
|
152
|
+
};
|
|
147
153
|
}
|
|
148
154
|
};
|
|
149
155
|
function subscribe(token, handleUpdate, key = Internal.arbitrary(), store = Internal.IMPLICIT.STORE) {
|
package/dist/index.d.ts
CHANGED
|
@@ -386,6 +386,8 @@ declare class Silo {
|
|
|
386
386
|
subscribe: typeof subscribe;
|
|
387
387
|
undo: typeof undo;
|
|
388
388
|
redo: typeof redo;
|
|
389
|
+
moleculeFamily: typeof moleculeFamily;
|
|
390
|
+
makeMolecule: typeof makeMolecule;
|
|
389
391
|
constructor(config: Store[`config`], fromStore?: Store | null);
|
|
390
392
|
}
|
|
391
393
|
|
package/dist/index.js
CHANGED
|
@@ -123,6 +123,12 @@ var Silo = class {
|
|
|
123
123
|
this.redo = (token) => {
|
|
124
124
|
timeTravel(`redo`, token, s);
|
|
125
125
|
};
|
|
126
|
+
this.moleculeFamily = (...params) => {
|
|
127
|
+
return createMoleculeFamily(...params, s);
|
|
128
|
+
};
|
|
129
|
+
this.makeMolecule = (...params) => {
|
|
130
|
+
return makeMoleculeInStore(s, ...params);
|
|
131
|
+
};
|
|
126
132
|
}
|
|
127
133
|
};
|
|
128
134
|
function subscribe(token, handleUpdate, key = arbitrary(), store = IMPLICIT.STORE) {
|
package/internal/dist/index.cjs
CHANGED
|
@@ -858,7 +858,16 @@ var registerSelector = (selectorKey, covered, store) => ({
|
|
|
858
858
|
case `molecule_family`:
|
|
859
859
|
return getFromStore(family, key, store);
|
|
860
860
|
default:
|
|
861
|
-
|
|
861
|
+
if (store.config.lifespan === `ephemeral`) {
|
|
862
|
+
dependency = findInStore(family, key, store);
|
|
863
|
+
} else {
|
|
864
|
+
const maybeDependency = seekInStore(family, key, store);
|
|
865
|
+
if (maybeDependency) {
|
|
866
|
+
dependency = maybeDependency;
|
|
867
|
+
} else {
|
|
868
|
+
throw new NotFoundError(family, key, store);
|
|
869
|
+
}
|
|
870
|
+
}
|
|
862
871
|
}
|
|
863
872
|
} else {
|
|
864
873
|
[dependency] = params;
|
package/internal/dist/index.js
CHANGED
|
@@ -583,7 +583,16 @@ var registerSelector = (selectorKey, covered, store) => ({
|
|
|
583
583
|
case `molecule_family`:
|
|
584
584
|
return getFromStore(family, key, store);
|
|
585
585
|
default:
|
|
586
|
-
|
|
586
|
+
if (store.config.lifespan === `ephemeral`) {
|
|
587
|
+
dependency = findInStore(family, key, store);
|
|
588
|
+
} else {
|
|
589
|
+
const maybeDependency = seekInStore(family, key, store);
|
|
590
|
+
if (maybeDependency) {
|
|
591
|
+
dependency = maybeDependency;
|
|
592
|
+
} else {
|
|
593
|
+
throw new NotFoundError(family, key, store);
|
|
594
|
+
}
|
|
595
|
+
}
|
|
587
596
|
}
|
|
588
597
|
} else {
|
|
589
598
|
[dependency] = params;
|
|
@@ -45,7 +45,16 @@ export const registerSelector = (
|
|
|
45
45
|
case `molecule_family`:
|
|
46
46
|
return getFromStore(family, key, store)
|
|
47
47
|
default:
|
|
48
|
-
|
|
48
|
+
if (store.config.lifespan === `ephemeral`) {
|
|
49
|
+
dependency = findInStore(family, key, store)
|
|
50
|
+
} else {
|
|
51
|
+
const maybeDependency = seekInStore(family, key, store)
|
|
52
|
+
if (maybeDependency) {
|
|
53
|
+
dependency = maybeDependency
|
|
54
|
+
} else {
|
|
55
|
+
throw new NotFoundError(family, key, store)
|
|
56
|
+
}
|
|
57
|
+
}
|
|
49
58
|
}
|
|
50
59
|
} else {
|
|
51
60
|
;[dependency] = params
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "atom.io",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.5",
|
|
4
4
|
"description": "Composable and testable reactive data library.",
|
|
5
5
|
"homepage": "https://atom.io.fyi",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -62,23 +62,23 @@
|
|
|
62
62
|
"@vitest/ui": "2.0.4",
|
|
63
63
|
"concurrently": "8.2.2",
|
|
64
64
|
"drizzle-kit": "0.23.0",
|
|
65
|
-
"drizzle-orm": "0.32.
|
|
65
|
+
"drizzle-orm": "0.32.1",
|
|
66
66
|
"eslint": "npm:eslint@8.57.0",
|
|
67
67
|
"eslint-v9": "npm:eslint@9.7.0",
|
|
68
|
-
"framer-motion": "11.3.
|
|
68
|
+
"framer-motion": "11.3.17",
|
|
69
69
|
"happy-dom": "14.12.3",
|
|
70
70
|
"http-proxy": "1.18.1",
|
|
71
71
|
"npmlog": "7.0.1",
|
|
72
72
|
"postgres": "3.4.4",
|
|
73
|
-
"preact": "10.
|
|
73
|
+
"preact": "10.23.1",
|
|
74
74
|
"react": "18.3.1",
|
|
75
75
|
"react-dom": "18.3.1",
|
|
76
76
|
"react-router-dom": "6.25.1",
|
|
77
77
|
"socket.io": "4.7.5",
|
|
78
78
|
"socket.io-client": "4.7.5",
|
|
79
79
|
"tmp": "0.2.3",
|
|
80
|
-
"tsup": "8.2.
|
|
81
|
-
"typescript": "5.5.
|
|
80
|
+
"tsup": "8.2.3",
|
|
81
|
+
"typescript": "5.5.4",
|
|
82
82
|
"vite": "5.3.4",
|
|
83
83
|
"vite-tsconfig-paths": "4.3.2",
|
|
84
84
|
"vitest": "2.0.4"
|
package/src/silo.ts
CHANGED
|
@@ -2,6 +2,7 @@ import type { findState } from "atom.io/ephemeral"
|
|
|
2
2
|
import type { Transceiver } from "atom.io/internal"
|
|
3
3
|
import {
|
|
4
4
|
createAtomFamily,
|
|
5
|
+
createMoleculeFamily,
|
|
5
6
|
createSelectorFamily,
|
|
6
7
|
createStandaloneAtom,
|
|
7
8
|
createStandaloneSelector,
|
|
@@ -10,6 +11,7 @@ import {
|
|
|
10
11
|
disposeFromStore,
|
|
11
12
|
findInStore,
|
|
12
13
|
getFromStore,
|
|
14
|
+
makeMoleculeInStore,
|
|
13
15
|
setIntoStore,
|
|
14
16
|
Store,
|
|
15
17
|
timeTravel,
|
|
@@ -20,6 +22,8 @@ import type {
|
|
|
20
22
|
AtomToken,
|
|
21
23
|
disposeState,
|
|
22
24
|
getState,
|
|
25
|
+
makeMolecule,
|
|
26
|
+
moleculeFamily,
|
|
23
27
|
MutableAtomFamily,
|
|
24
28
|
MutableAtomFamilyOptions,
|
|
25
29
|
MutableAtomOptions,
|
|
@@ -53,6 +57,8 @@ export class Silo {
|
|
|
53
57
|
public subscribe: typeof subscribe
|
|
54
58
|
public undo: typeof undo
|
|
55
59
|
public redo: typeof redo
|
|
60
|
+
public moleculeFamily: typeof moleculeFamily
|
|
61
|
+
public makeMolecule: typeof makeMolecule
|
|
56
62
|
public constructor(config: Store[`config`], fromStore: Store | null = null) {
|
|
57
63
|
const s = new Store(config, fromStore)
|
|
58
64
|
function _atom<T>(options: RegularAtomOptions<T>): RegularAtomToken<T>
|
|
@@ -102,5 +108,11 @@ export class Silo {
|
|
|
102
108
|
this.redo = (token) => {
|
|
103
109
|
timeTravel(`redo`, token, s)
|
|
104
110
|
}
|
|
111
|
+
this.moleculeFamily = ((...params: Parameters<typeof moleculeFamily>) => {
|
|
112
|
+
return createMoleculeFamily(...params, s)
|
|
113
|
+
}) as any
|
|
114
|
+
this.makeMolecule = ((...params: Parameters<typeof makeMolecule>) => {
|
|
115
|
+
return makeMoleculeInStore(s, ...params)
|
|
116
|
+
}) as any
|
|
105
117
|
}
|
|
106
118
|
}
|