@effect/atom-solid 4.0.1 → 4.0.2
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/ai-docs/package.json +2 -2
- package/ai-docs/tsconfig.json +2 -1
- package/dist/Hooks.d.ts +13 -0
- package/dist/Hooks.d.ts.map +1 -1
- package/dist/Hooks.js +12 -0
- package/dist/Hooks.js.map +1 -1
- package/dist/RegistryContext.d.ts +3 -0
- package/dist/RegistryContext.d.ts.map +1 -1
- package/dist/RegistryContext.js +2 -0
- package/dist/RegistryContext.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/Hooks.ts +14 -0
- package/src/RegistryContext.ts +3 -0
- package/src/index.ts +1 -0
package/ai-docs/package.json
CHANGED
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"@effect/sql-sqlite-wasm": "workspace:*",
|
|
28
28
|
"@effect/vitest": "workspace:*",
|
|
29
29
|
"effect": "workspace:*",
|
|
30
|
-
"hono": "^4.13.
|
|
31
|
-
"nodemailer": "^10.0.
|
|
30
|
+
"hono": "^4.13.12",
|
|
31
|
+
"nodemailer": "^10.0.14"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@types/nodemailer": "^8.0.2"
|
package/ai-docs/tsconfig.json
CHANGED
package/dist/Hooks.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ import type { Accessor, ResourceOptions, ResourceReturn } from "solid-js";
|
|
|
17
17
|
* supplied through the hook. Later calls for the same atom in that registry are
|
|
18
18
|
* ignored.
|
|
19
19
|
*
|
|
20
|
+
* @stability unstable
|
|
20
21
|
* @category hooks
|
|
21
22
|
* @since 4.0.0
|
|
22
23
|
*/
|
|
@@ -25,6 +26,7 @@ export declare const useAtomInitialValues: (initialValues: Iterable<readonly [At
|
|
|
25
26
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
26
27
|
* a Solid accessor.
|
|
27
28
|
*
|
|
29
|
+
* @stability unstable
|
|
28
30
|
* @category hooks
|
|
29
31
|
* @since 4.0.0
|
|
30
32
|
*/
|
|
@@ -33,6 +35,7 @@ export declare const useAtomValue: {
|
|
|
33
35
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
34
36
|
* a Solid accessor.
|
|
35
37
|
*
|
|
38
|
+
* @stability unstable
|
|
36
39
|
* @category hooks
|
|
37
40
|
* @since 4.0.0
|
|
38
41
|
*/
|
|
@@ -41,6 +44,7 @@ export declare const useAtomValue: {
|
|
|
41
44
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
42
45
|
* a Solid accessor.
|
|
43
46
|
*
|
|
47
|
+
* @stability unstable
|
|
44
48
|
* @category hooks
|
|
45
49
|
* @since 4.0.0
|
|
46
50
|
*/
|
|
@@ -64,6 +68,7 @@ export declare const useAtomValue: {
|
|
|
64
68
|
* @see {@link useAtomSet} for mounting a writable atom while returning a setter
|
|
65
69
|
* @see {@link useAtomRefresh} for mounting an atom while returning a refresh callback
|
|
66
70
|
*
|
|
71
|
+
* @stability unstable
|
|
67
72
|
* @category hooks
|
|
68
73
|
* @since 4.0.0
|
|
69
74
|
*/
|
|
@@ -71,6 +76,7 @@ export declare const useAtomMount: <A>(atom: () => Atom.Atom<A>) => void;
|
|
|
71
76
|
/**
|
|
72
77
|
* Returns a setter for a writable atom without subscribing to its value.
|
|
73
78
|
*
|
|
79
|
+
* @stability unstable
|
|
74
80
|
* @category hooks
|
|
75
81
|
* @since 4.0.0
|
|
76
82
|
*/
|
|
@@ -80,6 +86,7 @@ export declare const useAtomSet: <R, W, Mode extends "value" | "promise" | "prom
|
|
|
80
86
|
/**
|
|
81
87
|
* Mounts an atom and returns a callback that refreshes the current atom.
|
|
82
88
|
*
|
|
89
|
+
* @stability unstable
|
|
83
90
|
* @category hooks
|
|
84
91
|
* @since 4.0.0
|
|
85
92
|
*/
|
|
@@ -102,6 +109,7 @@ export declare const useAtomRefresh: <A>(atom: () => Atom.Atom<A>) => () => void
|
|
|
102
109
|
* @see {@link useAtomValue} for subscribing to an atom without a setter
|
|
103
110
|
* @see {@link useAtomSet} for updating a writable atom without subscribing to its value
|
|
104
111
|
*
|
|
112
|
+
* @stability unstable
|
|
105
113
|
* @category hooks
|
|
106
114
|
* @since 4.0.0
|
|
107
115
|
*/
|
|
@@ -111,6 +119,7 @@ export declare const useAtom: <R, W, const Mode extends "value" | "promise" | "p
|
|
|
111
119
|
/**
|
|
112
120
|
* Subscribes a callback to an atom in the current Solid registry.
|
|
113
121
|
*
|
|
122
|
+
* @stability unstable
|
|
114
123
|
* @category hooks
|
|
115
124
|
* @since 4.0.0
|
|
116
125
|
*/
|
|
@@ -120,6 +129,7 @@ export declare const useAtomSubscribe: <A>(atom: () => Atom.Atom<A>, f: (_: A) =
|
|
|
120
129
|
/**
|
|
121
130
|
* Converts an `AsyncResult` atom into a Solid resource.
|
|
122
131
|
*
|
|
132
|
+
* @stability unstable
|
|
123
133
|
* @category hooks
|
|
124
134
|
* @since 4.0.0
|
|
125
135
|
*/
|
|
@@ -144,6 +154,7 @@ export declare const useAtomResource: <A, E>(atom: () => Atom.Atom<AsyncResult.A
|
|
|
144
154
|
* @see {@link useAtomValue} for reading an `Atom` from the current registry
|
|
145
155
|
* @see {@link useAtomRefPropValue} for reading a property ref value
|
|
146
156
|
*
|
|
157
|
+
* @stability unstable
|
|
147
158
|
* @category hooks
|
|
148
159
|
* @since 4.0.0
|
|
149
160
|
*/
|
|
@@ -169,6 +180,7 @@ export declare const useAtomRef: <A>(ref: () => AtomRef.ReadonlyRef<A>) => Acces
|
|
|
169
180
|
* @see {@link useAtomRef} for subscribing to an atom ref value
|
|
170
181
|
* @see {@link useAtomRefPropValue} for subscribing directly to a property value
|
|
171
182
|
*
|
|
183
|
+
* @stability unstable
|
|
172
184
|
* @category hooks
|
|
173
185
|
* @since 4.0.0
|
|
174
186
|
*/
|
|
@@ -195,6 +207,7 @@ export declare const useAtomRefProp: <A, K extends keyof A>(ref: () => AtomRef.A
|
|
|
195
207
|
* @see {@link useAtomRef} for subscribing to a whole atom ref value
|
|
196
208
|
* @see {@link useAtomRefProp} for returning the property ref directly
|
|
197
209
|
*
|
|
210
|
+
* @stability unstable
|
|
198
211
|
* @category hooks
|
|
199
212
|
* @since 4.0.0
|
|
200
213
|
*/
|
package/dist/Hooks.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hooks.d.ts","sourceRoot":"","sources":["../src/Hooks.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Hooks.d.ts","sourceRoot":"","sources":["../src/Hooks.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AACnC,OAAO,KAAK,WAAW,MAAM,+BAA+B,CAAA;AAC5D,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAA;AAC9C,OAAO,KAAK,KAAK,OAAO,MAAM,2BAA2B,CAAA;AAEzD,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAMzE;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,oBAAoB,kBAAmB,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,KAAG,IAa9F,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,EAAE;IACzB;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAA;IAC1C;;;;;;;OAOG;IACH,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,GA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AC,EAAE,CAAC,CAAC,CAAC,YAC1C,eAAe,CAAC,CAAC,CAAC,GAAG;IAC7B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAChD,KACA,cAAc,CAAC,CAAC,EAAE,IAAI,CAUxB,CAAA;AAID;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,UAAU,GAAI,CAAC,OAAO,MAAM,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,KAAG,QAAQ,CAAC,CAAC,CAQ3E,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,OAC5C,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QACvB,CAAC,KACN,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAuC,CAAA;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,eAAO,MAAM,mBAAmB,GAAI,CAAC,EAAE,CAAC,SAAS,MAAM,CAAC,OAAO,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CACzE,CAAA"}
|
package/dist/Hooks.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* for cleanup, subscribe callbacks, seed initial values, expose `AsyncResult`
|
|
5
5
|
* atoms as Solid resources, and read values from `AtomRef` references.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @since 4.0.0
|
|
8
9
|
*/
|
|
9
10
|
import * as Cause from "effect/Cause";
|
|
@@ -29,6 +30,7 @@ const initialValuesSet = /*#__PURE__*/new WeakMap();
|
|
|
29
30
|
* supplied through the hook. Later calls for the same atom in that registry are
|
|
30
31
|
* ignored.
|
|
31
32
|
*
|
|
33
|
+
* @stability unstable
|
|
32
34
|
* @category hooks
|
|
33
35
|
* @since 4.0.0
|
|
34
36
|
*/
|
|
@@ -50,6 +52,7 @@ export const useAtomInitialValues = initialValues => {
|
|
|
50
52
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
51
53
|
* a Solid accessor.
|
|
52
54
|
*
|
|
55
|
+
* @stability unstable
|
|
53
56
|
* @category hooks
|
|
54
57
|
* @since 4.0.0
|
|
55
58
|
*/
|
|
@@ -109,6 +112,7 @@ const flattenExit = exit => {
|
|
|
109
112
|
* @see {@link useAtomSet} for mounting a writable atom while returning a setter
|
|
110
113
|
* @see {@link useAtomRefresh} for mounting an atom while returning a refresh callback
|
|
111
114
|
*
|
|
115
|
+
* @stability unstable
|
|
112
116
|
* @category hooks
|
|
113
117
|
* @since 4.0.0
|
|
114
118
|
*/
|
|
@@ -119,6 +123,7 @@ export const useAtomMount = atom => {
|
|
|
119
123
|
/**
|
|
120
124
|
* Returns a setter for a writable atom without subscribing to its value.
|
|
121
125
|
*
|
|
126
|
+
* @stability unstable
|
|
122
127
|
* @category hooks
|
|
123
128
|
* @since 4.0.0
|
|
124
129
|
*/
|
|
@@ -130,6 +135,7 @@ export const useAtomSet = (atom, options) => {
|
|
|
130
135
|
/**
|
|
131
136
|
* Mounts an atom and returns a callback that refreshes the current atom.
|
|
132
137
|
*
|
|
138
|
+
* @stability unstable
|
|
133
139
|
* @category hooks
|
|
134
140
|
* @since 4.0.0
|
|
135
141
|
*/
|
|
@@ -157,6 +163,7 @@ export const useAtomRefresh = atom => {
|
|
|
157
163
|
* @see {@link useAtomValue} for subscribing to an atom without a setter
|
|
158
164
|
* @see {@link useAtomSet} for updating a writable atom without subscribing to its value
|
|
159
165
|
*
|
|
166
|
+
* @stability unstable
|
|
160
167
|
* @category hooks
|
|
161
168
|
* @since 4.0.0
|
|
162
169
|
*/
|
|
@@ -167,6 +174,7 @@ export const useAtom = (atom, options) => {
|
|
|
167
174
|
/**
|
|
168
175
|
* Subscribes a callback to an atom in the current Solid registry.
|
|
169
176
|
*
|
|
177
|
+
* @stability unstable
|
|
170
178
|
* @category hooks
|
|
171
179
|
* @since 4.0.0
|
|
172
180
|
*/
|
|
@@ -179,6 +187,7 @@ export const useAtomSubscribe = (atom, f, options) => {
|
|
|
179
187
|
/**
|
|
180
188
|
* Converts an `AsyncResult` atom into a Solid resource.
|
|
181
189
|
*
|
|
190
|
+
* @stability unstable
|
|
182
191
|
* @category hooks
|
|
183
192
|
* @since 4.0.0
|
|
184
193
|
*/
|
|
@@ -212,6 +221,7 @@ const constUnresolvedPromise = /*#__PURE__*/new Promise(() => {});
|
|
|
212
221
|
* @see {@link useAtomValue} for reading an `Atom` from the current registry
|
|
213
222
|
* @see {@link useAtomRefPropValue} for reading a property ref value
|
|
214
223
|
*
|
|
224
|
+
* @stability unstable
|
|
215
225
|
* @category hooks
|
|
216
226
|
* @since 4.0.0
|
|
217
227
|
*/
|
|
@@ -245,6 +255,7 @@ export const useAtomRef = ref => {
|
|
|
245
255
|
* @see {@link useAtomRef} for subscribing to an atom ref value
|
|
246
256
|
* @see {@link useAtomRefPropValue} for subscribing directly to a property value
|
|
247
257
|
*
|
|
258
|
+
* @stability unstable
|
|
248
259
|
* @category hooks
|
|
249
260
|
* @since 4.0.0
|
|
250
261
|
*/
|
|
@@ -271,6 +282,7 @@ export const useAtomRefProp = (ref, prop) => createMemo(() => ref().prop(prop));
|
|
|
271
282
|
* @see {@link useAtomRef} for subscribing to a whole atom ref value
|
|
272
283
|
* @see {@link useAtomRefProp} for returning the property ref directly
|
|
273
284
|
*
|
|
285
|
+
* @stability unstable
|
|
274
286
|
* @category hooks
|
|
275
287
|
* @since 4.0.0
|
|
276
288
|
*/
|
package/dist/Hooks.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Hooks.js","names":[],"sources":["../src/Hooks.ts"],"sourcesContent":[null],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"Hooks.js","names":[],"sources":["../src/Hooks.ts"],"sourc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C;EACF,OAAO,KAAK;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,MAAM,cAAc,GAAG,CAC5B,GAA6B,EAC7B,IAAO,KAC6B,UAAU,CAAC,MAAM,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAExE;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BA,OAAO,MAAM,mBAAmB,GAAG,CAAuB,GAA6B,EAAE,IAAO,KAC9F,UAAU,CAAC,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* atoms. Sharing one registry through Solid context lets components and
|
|
5
5
|
* computations in the same owner tree read and write the same atom state.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @since 4.0.0
|
|
8
9
|
*/
|
|
9
10
|
import type * as Atom from "effect/reactivity/Atom";
|
|
@@ -24,6 +25,7 @@ import type { JSX } from "solid-js";
|
|
|
24
25
|
*
|
|
25
26
|
* @see {@link RegistryProvider} for creating and providing a registry for a Solid subtree
|
|
26
27
|
*
|
|
28
|
+
* @stability unstable
|
|
27
29
|
* @category context
|
|
28
30
|
* @since 4.0.0
|
|
29
31
|
*/
|
|
@@ -51,6 +53,7 @@ export declare const RegistryContext: import("solid-js").Context<AtomRegistry.At
|
|
|
51
53
|
*
|
|
52
54
|
* @see {@link RegistryContext} for the context supplied by this provider
|
|
53
55
|
*
|
|
56
|
+
* @stability unstable
|
|
54
57
|
* @category context
|
|
55
58
|
* @since 4.0.0
|
|
56
59
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryContext.d.ts","sourceRoot":"","sources":["../src/RegistryContext.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RegistryContext.d.ts","sourceRoot":"","sources":["../src/RegistryContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,KAAK,IAAI,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,YAAY,MAAM,gCAAgC,CAAA;AAC9D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAGnC;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,uDAAgE,CAAA;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,eAAO,MAAM,gBAAgB,YAAa;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,GAAG,SAAS,CAAA;IAC3C,QAAQ,CAAC,aAAa,CAAC,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,CAAC,GAAG,SAAS,CAAA;IAC7E,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,IAAI,KAAK,MAAM,IAAI,CAAC,GAAG,SAAS,CAAA;IACnE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/C,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7C,gBAcA,CAAA"}
|
package/dist/RegistryContext.js
CHANGED
|
@@ -15,6 +15,7 @@ import { createComponent, createContext, onCleanup } from "solid-js";
|
|
|
15
15
|
*
|
|
16
16
|
* @see {@link RegistryProvider} for creating and providing a registry for a Solid subtree
|
|
17
17
|
*
|
|
18
|
+
* @stability unstable
|
|
18
19
|
* @category context
|
|
19
20
|
* @since 4.0.0
|
|
20
21
|
*/
|
|
@@ -42,6 +43,7 @@ export const RegistryContext = /*#__PURE__*/createContext(/*#__PURE__*/AtomRegis
|
|
|
42
43
|
*
|
|
43
44
|
* @see {@link RegistryContext} for the context supplied by this provider
|
|
44
45
|
*
|
|
46
|
+
* @stability unstable
|
|
45
47
|
* @category context
|
|
46
48
|
* @since 4.0.0
|
|
47
49
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryContext.js","names":[],"sources":["../src/RegistryContext.ts"],"sourcesContent":[null],"mappings":"
|
|
1
|
+
{"version":3,"file":"RegistryContext.js","names":[],"sources":["../src/RegistryContext.ts"],"sourcesContent":[null],"mappings":"AAUA,OAAO,KAAK,YAAY,MAAM,gCAAgC;AAE9D,SAAS,eAAe,EAAE,aAAa,EAAE,SAAS,QAAQ,UAAU;AAEpE;;;;;;;;;;;;;;;;;;;AAmBA,OAAO,MAAM,eAAe,gBAAG,aAAa,cAA4B,YAAY,CAAC,IAAI,EAAE,CAAC;AAE5F;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,OAAO,MAAM,gBAAgB,GAAI,OAMhC,IAAI;EACH,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC;IACjC,YAAY,EAAE,OAAO,CAAC,YAAY;IAClC,aAAa,EAAE,OAAO,CAAC,aAAa;IACpC,iBAAiB,EAAE,OAAO,CAAC,iBAAiB;IAC5C,cAAc,EAAE,OAAO,CAAC;GACzB,CAAC;EACF,SAAS,CAAC,MAAM,QAAQ,CAAC,OAAO,EAAE,CAAC;EACnC,OAAO,eAAe,CAAC,eAAe,CAAC,QAAQ,EAAE;IAC/C,KAAK,EAAE,QAAQ;IACf,IAAI,QAAQ;MACV,OAAO,OAAO,CAAC,QAAQ;IACzB;GACD,CAAC;AACJ,CAAC","ignoreList":[]}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,cAAc,YAAY,CAAA;AAE1B;;GAEG;AACH,cAAc,sBAAsB,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":[null],"mappings":"AAAA;;;;AAKA;;;AAGA,cAAc,YAAY;AAE1B;;;AAGA,cAAc,sBAAsB","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@effect/atom-solid",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"description": "SolidJS bindings for the Effect Atom modules",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"solid-js": ">=1.9.14 <2.0.0",
|
|
51
|
-
"effect": "^4.0.
|
|
51
|
+
"effect": "^4.0.2"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"@solidjs/testing-library": "^0.8.10",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@testing-library/jest-dom": "^7.0.1",
|
|
57
57
|
"jsdom": "~30.0.1",
|
|
58
58
|
"solid-js": "^1.9.15",
|
|
59
|
-
"effect": "^4.0.
|
|
59
|
+
"effect": "^4.0.2"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsc -b tsconfig.json && pnpm babel",
|
package/src/Hooks.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* for cleanup, subscribe callbacks, seed initial values, expose `AsyncResult`
|
|
5
5
|
* atoms as Solid resources, and read values from `AtomRef` references.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @since 4.0.0
|
|
8
9
|
*/
|
|
9
10
|
import * as Cause from "effect/Cause"
|
|
@@ -33,6 +34,7 @@ const initialValuesSet = new WeakMap<AtomRegistry.AtomRegistry, WeakSet<Atom.Ato
|
|
|
33
34
|
* supplied through the hook. Later calls for the same atom in that registry are
|
|
34
35
|
* ignored.
|
|
35
36
|
*
|
|
37
|
+
* @stability unstable
|
|
36
38
|
* @category hooks
|
|
37
39
|
* @since 4.0.0
|
|
38
40
|
*/
|
|
@@ -55,6 +57,7 @@ export const useAtomInitialValues = (initialValues: Iterable<readonly [Atom.Atom
|
|
|
55
57
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
56
58
|
* a Solid accessor.
|
|
57
59
|
*
|
|
60
|
+
* @stability unstable
|
|
58
61
|
* @category hooks
|
|
59
62
|
* @since 4.0.0
|
|
60
63
|
*/
|
|
@@ -63,6 +66,7 @@ export const useAtomValue: {
|
|
|
63
66
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
64
67
|
* a Solid accessor.
|
|
65
68
|
*
|
|
69
|
+
* @stability unstable
|
|
66
70
|
* @category hooks
|
|
67
71
|
* @since 4.0.0
|
|
68
72
|
*/
|
|
@@ -71,6 +75,7 @@ export const useAtomValue: {
|
|
|
71
75
|
* Subscribes to an atom in the current Solid registry and returns its value as
|
|
72
76
|
* a Solid accessor.
|
|
73
77
|
*
|
|
78
|
+
* @stability unstable
|
|
74
79
|
* @category hooks
|
|
75
80
|
* @since 4.0.0
|
|
76
81
|
*/
|
|
@@ -150,6 +155,7 @@ const flattenExit = <A, E>(exit: Exit.Exit<A, E>): A => {
|
|
|
150
155
|
* @see {@link useAtomSet} for mounting a writable atom while returning a setter
|
|
151
156
|
* @see {@link useAtomRefresh} for mounting an atom while returning a refresh callback
|
|
152
157
|
*
|
|
158
|
+
* @stability unstable
|
|
153
159
|
* @category hooks
|
|
154
160
|
* @since 4.0.0
|
|
155
161
|
*/
|
|
@@ -161,6 +167,7 @@ export const useAtomMount = <A>(atom: () => Atom.Atom<A>): void => {
|
|
|
161
167
|
/**
|
|
162
168
|
* Returns a setter for a writable atom without subscribing to its value.
|
|
163
169
|
*
|
|
170
|
+
* @stability unstable
|
|
164
171
|
* @category hooks
|
|
165
172
|
* @since 4.0.0
|
|
166
173
|
*/
|
|
@@ -189,6 +196,7 @@ export const useAtomSet = <
|
|
|
189
196
|
/**
|
|
190
197
|
* Mounts an atom and returns a callback that refreshes the current atom.
|
|
191
198
|
*
|
|
199
|
+
* @stability unstable
|
|
192
200
|
* @category hooks
|
|
193
201
|
* @since 4.0.0
|
|
194
202
|
*/
|
|
@@ -217,6 +225,7 @@ export const useAtomRefresh = <A>(atom: () => Atom.Atom<A>): () => void => {
|
|
|
217
225
|
* @see {@link useAtomValue} for subscribing to an atom without a setter
|
|
218
226
|
* @see {@link useAtomSet} for updating a writable atom without subscribing to its value
|
|
219
227
|
*
|
|
228
|
+
* @stability unstable
|
|
220
229
|
* @category hooks
|
|
221
230
|
* @since 4.0.0
|
|
222
231
|
*/
|
|
@@ -245,6 +254,7 @@ export const useAtom = <R, W, const Mode extends "value" | "promise" | "promiseE
|
|
|
245
254
|
/**
|
|
246
255
|
* Subscribes a callback to an atom in the current Solid registry.
|
|
247
256
|
*
|
|
257
|
+
* @stability unstable
|
|
248
258
|
* @category hooks
|
|
249
259
|
* @since 4.0.0
|
|
250
260
|
*/
|
|
@@ -262,6 +272,7 @@ export const useAtomSubscribe = <A>(
|
|
|
262
272
|
/**
|
|
263
273
|
* Converts an `AsyncResult` atom into a Solid resource.
|
|
264
274
|
*
|
|
275
|
+
* @stability unstable
|
|
265
276
|
* @category hooks
|
|
266
277
|
* @since 4.0.0
|
|
267
278
|
*/
|
|
@@ -302,6 +313,7 @@ const constUnresolvedPromise = new Promise<never>(() => {})
|
|
|
302
313
|
* @see {@link useAtomValue} for reading an `Atom` from the current registry
|
|
303
314
|
* @see {@link useAtomRefPropValue} for reading a property ref value
|
|
304
315
|
*
|
|
316
|
+
* @stability unstable
|
|
305
317
|
* @category hooks
|
|
306
318
|
* @since 4.0.0
|
|
307
319
|
*/
|
|
@@ -336,6 +348,7 @@ export const useAtomRef = <A>(ref: () => AtomRef.ReadonlyRef<A>): Accessor<A> =>
|
|
|
336
348
|
* @see {@link useAtomRef} for subscribing to an atom ref value
|
|
337
349
|
* @see {@link useAtomRefPropValue} for subscribing directly to a property value
|
|
338
350
|
*
|
|
351
|
+
* @stability unstable
|
|
339
352
|
* @category hooks
|
|
340
353
|
* @since 4.0.0
|
|
341
354
|
*/
|
|
@@ -366,6 +379,7 @@ export const useAtomRefProp = <A, K extends keyof A>(
|
|
|
366
379
|
* @see {@link useAtomRef} for subscribing to a whole atom ref value
|
|
367
380
|
* @see {@link useAtomRefProp} for returning the property ref directly
|
|
368
381
|
*
|
|
382
|
+
* @stability unstable
|
|
369
383
|
* @category hooks
|
|
370
384
|
* @since 4.0.0
|
|
371
385
|
*/
|
package/src/RegistryContext.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* atoms. Sharing one registry through Solid context lets components and
|
|
5
5
|
* computations in the same owner tree read and write the same atom state.
|
|
6
6
|
*
|
|
7
|
+
* @stability unstable
|
|
7
8
|
* @since 4.0.0
|
|
8
9
|
*/
|
|
9
10
|
import type * as Atom from "effect/reactivity/Atom"
|
|
@@ -26,6 +27,7 @@ import { createComponent, createContext, onCleanup } from "solid-js"
|
|
|
26
27
|
*
|
|
27
28
|
* @see {@link RegistryProvider} for creating and providing a registry for a Solid subtree
|
|
28
29
|
*
|
|
30
|
+
* @stability unstable
|
|
29
31
|
* @category context
|
|
30
32
|
* @since 4.0.0
|
|
31
33
|
*/
|
|
@@ -54,6 +56,7 @@ export const RegistryContext = createContext<AtomRegistry.AtomRegistry>(AtomRegi
|
|
|
54
56
|
*
|
|
55
57
|
* @see {@link RegistryContext} for the context supplied by this provider
|
|
56
58
|
*
|
|
59
|
+
* @stability unstable
|
|
57
60
|
* @category context
|
|
58
61
|
* @since 4.0.0
|
|
59
62
|
*/
|