@ersbeth/picoflow 0.0.1 → 0.2.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.
Files changed (169) hide show
  1. package/api/doc/index.md +1 -1
  2. package/api/doc/picoflow.array.md +55 -0
  3. package/api/doc/picoflow.constant.md +55 -0
  4. package/api/doc/picoflow.derivation.md +1 -1
  5. package/api/doc/picoflow.effect.md +1 -1
  6. package/api/doc/picoflow.flowarray._constructor_.md +49 -0
  7. package/api/doc/picoflow.flowarray._lastaction.md +13 -0
  8. package/api/doc/picoflow.flowarray.clear.md +17 -0
  9. package/api/doc/picoflow.flowarray.dispose.md +55 -0
  10. package/api/doc/picoflow.flowarray.get.md +19 -0
  11. package/api/doc/picoflow.flowarray.length.md +13 -0
  12. package/api/doc/picoflow.flowarray.md +273 -0
  13. package/api/doc/picoflow.flowarray.pop.md +17 -0
  14. package/api/doc/picoflow.flowarray.push.md +53 -0
  15. package/api/doc/picoflow.flowarray.set.md +53 -0
  16. package/api/doc/picoflow.flowarray.setitem.md +69 -0
  17. package/api/doc/picoflow.flowarray.shift.md +17 -0
  18. package/api/doc/picoflow.flowarray.splice.md +85 -0
  19. package/api/doc/picoflow.flowarray.unshift.md +53 -0
  20. package/api/doc/picoflow.flowarrayaction.md +37 -0
  21. package/api/doc/picoflow.flowconstant._constructor_.md +49 -0
  22. package/api/doc/picoflow.flowconstant.get.md +25 -0
  23. package/api/doc/picoflow.flowconstant.md +88 -0
  24. package/api/doc/picoflow.flowderivation._constructor_.md +2 -2
  25. package/api/doc/picoflow.flowderivation.get.md +2 -2
  26. package/api/doc/picoflow.flowderivation.md +2 -2
  27. package/api/doc/picoflow.flowdisposable.dispose.md +55 -0
  28. package/api/doc/picoflow.flowdisposable.md +43 -0
  29. package/api/doc/picoflow.floweffect._constructor_.md +7 -2
  30. package/api/doc/picoflow.floweffect.dispose.md +3 -3
  31. package/api/doc/picoflow.floweffect.disposed.md +1 -1
  32. package/api/doc/picoflow.floweffect.md +4 -4
  33. package/api/doc/picoflow.flowgetter.md +2 -2
  34. package/api/doc/picoflow.flowmap._lastdeleted.md +1 -1
  35. package/api/doc/picoflow.flowmap._lastset.md +1 -1
  36. package/api/doc/picoflow.flowmap.delete.md +6 -2
  37. package/api/doc/picoflow.flowmap.md +5 -7
  38. package/api/doc/picoflow.flowmap.setat.md +6 -2
  39. package/api/doc/picoflow.flowobservable.get.md +3 -3
  40. package/api/doc/picoflow.flowobservable.md +18 -4
  41. package/api/doc/picoflow.flowobservable.subscribe.md +55 -0
  42. package/api/doc/picoflow.flowresource._constructor_.md +2 -18
  43. package/api/doc/picoflow.flowresource.fetch.md +1 -1
  44. package/api/doc/picoflow.flowresource.get.md +4 -4
  45. package/api/doc/picoflow.flowresource.md +4 -4
  46. package/api/doc/picoflow.flowresourceasync._constructor_.md +49 -0
  47. package/api/doc/picoflow.flowresourceasync.fetch.md +27 -0
  48. package/api/doc/picoflow.flowresourceasync.get.md +23 -0
  49. package/api/doc/picoflow.flowresourceasync.md +100 -0
  50. package/api/doc/picoflow.flowsignal.dispose.md +42 -8
  51. package/api/doc/picoflow.flowsignal.disposed.md +2 -2
  52. package/api/doc/picoflow.flowsignal.md +8 -7
  53. package/api/doc/picoflow.flowsignal.trigger.md +3 -7
  54. package/api/doc/picoflow.flowstate.md +4 -52
  55. package/api/doc/picoflow.flowstate.set.md +5 -5
  56. package/api/doc/picoflow.flowstream._constructor_.md +3 -19
  57. package/api/doc/picoflow.flowstream.dispose.md +1 -1
  58. package/api/doc/picoflow.flowstream.get.md +4 -4
  59. package/api/doc/picoflow.flowstream.md +5 -5
  60. package/api/doc/picoflow.flowstreamasync._constructor_.md +54 -0
  61. package/api/doc/picoflow.flowstreamasync.dispose.md +21 -0
  62. package/api/doc/picoflow.flowstreamasync.get.md +23 -0
  63. package/api/doc/picoflow.flowstreamasync.md +100 -0
  64. package/api/doc/picoflow.flowstreamdisposer.md +13 -0
  65. package/api/doc/picoflow.flowstreamsetter.md +13 -0
  66. package/api/doc/picoflow.flowstreamupdater.md +19 -0
  67. package/api/doc/picoflow.flowwatcher.md +1 -1
  68. package/api/doc/picoflow.isdisposable.md +55 -0
  69. package/api/doc/picoflow.map.md +1 -1
  70. package/api/doc/picoflow.md +149 -13
  71. package/api/doc/picoflow.resource.md +2 -18
  72. package/api/doc/picoflow.resourceasync.md +55 -0
  73. package/api/doc/picoflow.signal.md +1 -1
  74. package/api/doc/picoflow.state.md +3 -3
  75. package/api/doc/picoflow.stream.md +2 -18
  76. package/api/doc/picoflow.streamasync.md +55 -0
  77. package/api/picoflow.public.api.md +192 -0
  78. package/api-extractor.json +2 -1
  79. package/dist/picoflow.js +513 -305
  80. package/dist/types/advanced/array.d.ts +116 -0
  81. package/dist/types/advanced/array.d.ts.map +1 -0
  82. package/dist/types/advanced/index.d.ts +9 -0
  83. package/dist/types/advanced/index.d.ts.map +1 -0
  84. package/dist/types/{map.d.ts → advanced/map.d.ts} +12 -12
  85. package/dist/types/advanced/map.d.ts.map +1 -0
  86. package/dist/types/advanced/resource.d.ts +39 -0
  87. package/dist/types/advanced/resource.d.ts.map +1 -0
  88. package/dist/types/{resource.d.ts → advanced/resourceAsync.d.ts} +6 -11
  89. package/dist/types/advanced/resourceAsync.d.ts.map +1 -0
  90. package/dist/types/advanced/stream.d.ts +59 -0
  91. package/dist/types/advanced/stream.d.ts.map +1 -0
  92. package/dist/types/advanced/streamAsync.d.ts +43 -0
  93. package/dist/types/advanced/streamAsync.d.ts.map +1 -0
  94. package/dist/types/basic/constant.d.ts +32 -0
  95. package/dist/types/basic/constant.d.ts.map +1 -0
  96. package/dist/types/basic/derivation.d.ts +40 -0
  97. package/dist/types/basic/derivation.d.ts.map +1 -0
  98. package/dist/types/basic/disposable.d.ts +23 -0
  99. package/dist/types/basic/disposable.d.ts.map +1 -0
  100. package/dist/types/basic/effect.d.ts +56 -0
  101. package/dist/types/basic/effect.d.ts.map +1 -0
  102. package/dist/types/basic/index.d.ts +11 -0
  103. package/dist/types/basic/index.d.ts.map +1 -0
  104. package/dist/types/basic/observable.d.ts +34 -0
  105. package/dist/types/basic/observable.d.ts.map +1 -0
  106. package/dist/types/basic/signal.d.ts +40 -0
  107. package/dist/types/basic/signal.d.ts.map +1 -0
  108. package/dist/types/basic/state.d.ts +26 -0
  109. package/dist/types/basic/state.d.ts.map +1 -0
  110. package/dist/types/creators.d.ts +38 -13
  111. package/dist/types/creators.d.ts.map +1 -1
  112. package/dist/types/index.d.ts +4 -9
  113. package/dist/types/index.d.ts.map +1 -1
  114. package/package.json +1 -1
  115. package/src/advanced/array.ts +224 -0
  116. package/src/advanced/index.ts +12 -0
  117. package/src/{map.ts → advanced/map.ts} +14 -14
  118. package/src/advanced/resource.ts +56 -0
  119. package/src/{resource.ts → advanced/resourceAsync.ts} +9 -16
  120. package/src/advanced/stream.ts +87 -0
  121. package/src/advanced/streamAsync.ts +82 -0
  122. package/src/basic/constant.ts +64 -0
  123. package/src/basic/derivation.ts +86 -0
  124. package/src/basic/disposable.ts +27 -0
  125. package/src/basic/effect.ts +96 -0
  126. package/src/basic/index.ts +10 -0
  127. package/src/basic/observable.ts +51 -0
  128. package/src/basic/signal.ts +117 -0
  129. package/src/basic/state.ts +39 -0
  130. package/src/creators.ts +66 -15
  131. package/src/index.ts +26 -11
  132. package/test/array.test.ts +620 -0
  133. package/test/constant.test.ts +46 -0
  134. package/test/derivation.test.ts +30 -6
  135. package/test/effect.test.ts +29 -0
  136. package/test/map.test.ts +38 -0
  137. package/test/resource.test.ts +18 -16
  138. package/test/resourceAsync.test.ts +108 -0
  139. package/test/signal.test.ts +18 -1
  140. package/test/state.test.ts +107 -2
  141. package/test/stream.test.ts +38 -13
  142. package/test/streamAsync.test.ts +194 -0
  143. package/tsconfig.json +3 -1
  144. package/api/doc/picoflow.flowdisposer.md +0 -13
  145. package/api/doc/picoflow.flowsetter.md +0 -13
  146. package/api/doc/picoflow.flowstate._constructor_.md +0 -49
  147. package/api/doc/picoflow.flowstate.get.md +0 -23
  148. package/api/doc/picoflow.flowupdater.md +0 -19
  149. package/api/picoflow.api.md +0 -145
  150. package/dist/types/derivation.d.ts +0 -58
  151. package/dist/types/derivation.d.ts.map +0 -1
  152. package/dist/types/effect.d.ts +0 -108
  153. package/dist/types/effect.d.ts.map +0 -1
  154. package/dist/types/map.d.ts.map +0 -1
  155. package/dist/types/observable.d.ts +0 -40
  156. package/dist/types/observable.d.ts.map +0 -1
  157. package/dist/types/resource.d.ts.map +0 -1
  158. package/dist/types/signal.d.ts +0 -111
  159. package/dist/types/signal.d.ts.map +0 -1
  160. package/dist/types/state.d.ts +0 -39
  161. package/dist/types/state.d.ts.map +0 -1
  162. package/dist/types/stream.d.ts +0 -71
  163. package/dist/types/stream.d.ts.map +0 -1
  164. package/src/derivation.ts +0 -96
  165. package/src/effect.ts +0 -152
  166. package/src/observable.ts +0 -50
  167. package/src/signal.ts +0 -166
  168. package/src/state.ts +0 -52
  169. package/src/stream.ts +0 -99
@@ -1,6 +1,6 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [picoflow](./picoflow.md)
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md)
4
4
 
5
5
  ## picoflow package
6
6
 
@@ -21,6 +21,28 @@ Description
21
21
  </th></tr></thead>
22
22
  <tbody><tr><td>
23
23
 
24
+ [FlowArray](./picoflow.flowarray.md)
25
+
26
+
27
+ </td><td>
28
+
29
+ Represents a reactive array.
30
+
31
+
32
+ </td></tr>
33
+ <tr><td>
34
+
35
+ [FlowConstant](./picoflow.flowconstant.md)
36
+
37
+
38
+ </td><td>
39
+
40
+ Represents a reactive and immutable constant value computed lazily upon first access.
41
+
42
+
43
+ </td></tr>
44
+ <tr><td>
45
+
24
46
  [FlowDerivation](./picoflow.flowderivation.md)
25
47
 
26
48
 
@@ -37,7 +59,7 @@ Represents a reactive derivation whose value is computed based on other reactive
37
59
 
38
60
  </td><td>
39
61
 
40
- Represents a reactive effect that executes a sideeffect function based on its tracked dependencies.
62
+ Represents a reactive effect that executes side-effect functions based on its tracked dependencies.
41
63
 
42
64
 
43
65
  </td></tr>
@@ -48,7 +70,7 @@ Represents a reactive effect that executes a side‐effect function based on its
48
70
 
49
71
  </td><td>
50
72
 
51
- Represents a reactive map of states that extends [FlowState](./picoflow.flowstate.md) for a Map of key/value pairs.
73
+ Represents a reactive map of states extending [FlowState](./picoflow.flowstate.md) for a Map of key/value pairs.
52
74
 
53
75
 
54
76
  </td></tr>
@@ -62,6 +84,17 @@ Represents a reactive map of states that extends [FlowState](./picoflow.flowstat
62
84
  Represents a reactive resource that asynchronously fetches its value.
63
85
 
64
86
 
87
+ </td></tr>
88
+ <tr><td>
89
+
90
+ [FlowResourceAsync](./picoflow.flowresourceasync.md)
91
+
92
+
93
+ </td><td>
94
+
95
+ Represents a reactive resource that asynchronously fetches its value.
96
+
97
+
65
98
  </td></tr>
66
99
  <tr><td>
67
100
 
@@ -95,6 +128,17 @@ Represents a reactive state that holds a mutable value.
95
128
  Represents a reactive stream that updates its value based on an updater function.
96
129
 
97
130
 
131
+ </td></tr>
132
+ <tr><td>
133
+
134
+ [FlowStreamAsync](./picoflow.flowstreamasync.md)
135
+
136
+
137
+ </td><td>
138
+
139
+ Represents an asynchronous reactive stream that updates its value based on an updater function.
140
+
141
+
98
142
  </td></tr>
99
143
  </tbody></table>
100
144
 
@@ -118,7 +162,7 @@ Description
118
162
 
119
163
  </td><td>
120
164
 
121
- Represents a reactive observable that carries a value.
165
+ Represents a reactive observable that holds and tracks a value.
122
166
 
123
167
 
124
168
  </td></tr>
@@ -139,6 +183,28 @@ Description
139
183
  </th></tr></thead>
140
184
  <tbody><tr><td>
141
185
 
186
+ [array(initial)](./picoflow.array.md)
187
+
188
+
189
+ </td><td>
190
+
191
+ Creates a new reactive array.
192
+
193
+
194
+ </td></tr>
195
+ <tr><td>
196
+
197
+ [constant(value)](./picoflow.constant.md)
198
+
199
+
200
+ </td><td>
201
+
202
+ Creates a new reactive constant.
203
+
204
+
205
+ </td></tr>
206
+ <tr><td>
207
+
142
208
  [derivation(fn)](./picoflow.derivation.md)
143
209
 
144
210
 
@@ -158,6 +224,17 @@ Creates a new reactive derivation whose value is computed based on other reactiv
158
224
  Creates a new reactive effect that executes a side-effect function based on its dependencies.
159
225
 
160
226
 
227
+ </td></tr>
228
+ <tr><td>
229
+
230
+ [isDisposable(obj)](./picoflow.isdisposable.md)
231
+
232
+
233
+ </td><td>
234
+
235
+ Checks whether an object implements the FlowDisposable interface.
236
+
237
+
161
238
  </td></tr>
162
239
  <tr><td>
163
240
 
@@ -172,7 +249,7 @@ Creates a new reactive map state.
172
249
  </td></tr>
173
250
  <tr><td>
174
251
 
175
- [resource(fn, initial)](./picoflow.resource.md)
252
+ [resource(fn)](./picoflow.resource.md)
176
253
 
177
254
 
178
255
  </td><td>
@@ -180,6 +257,17 @@ Creates a new reactive map state.
180
257
  Creates a new reactive resource that asynchronously fetches its value.
181
258
 
182
259
 
260
+ </td></tr>
261
+ <tr><td>
262
+
263
+ [resourceAsync(fn)](./picoflow.resourceasync.md)
264
+
265
+
266
+ </td><td>
267
+
268
+ Creates a new reactive asynchronous resource that fetches its value.
269
+
270
+
183
271
  </td></tr>
184
272
  <tr><td>
185
273
 
@@ -205,7 +293,7 @@ Creates a new reactive state holding a value.
205
293
  </td></tr>
206
294
  <tr><td>
207
295
 
208
- [stream(updater, initial)](./picoflow.stream.md)
296
+ [stream(updater)](./picoflow.stream.md)
209
297
 
210
298
 
211
299
  </td><td>
@@ -213,6 +301,43 @@ Creates a new reactive state holding a value.
213
301
  Creates a new reactive stream.
214
302
 
215
303
 
304
+ </td></tr>
305
+ <tr><td>
306
+
307
+ [streamAsync(updater)](./picoflow.streamasync.md)
308
+
309
+
310
+ </td><td>
311
+
312
+ Creates a new reactive asynchronous stream.
313
+
314
+
315
+ </td></tr>
316
+ </tbody></table>
317
+
318
+ ## Interfaces
319
+
320
+ <table><thead><tr><th>
321
+
322
+ Interface
323
+
324
+
325
+ </th><th>
326
+
327
+ Description
328
+
329
+
330
+ </th></tr></thead>
331
+ <tbody><tr><td>
332
+
333
+ [FlowDisposable](./picoflow.flowdisposable.md)
334
+
335
+
336
+ </td><td>
337
+
338
+ Represents an object with a disposable lifecycle.
339
+
340
+
216
341
  </td></tr>
217
342
  </tbody></table>
218
343
 
@@ -231,12 +356,12 @@ Description
231
356
  </th></tr></thead>
232
357
  <tbody><tr><td>
233
358
 
234
- [FlowDisposer](./picoflow.flowdisposer.md)
359
+ [FlowArrayAction](./picoflow.flowarrayaction.md)
235
360
 
236
361
 
237
362
  </td><td>
238
363
 
239
- A function that disposes of a resource.
364
+ Represents the actions that can be performed on a FlowArray.
240
365
 
241
366
 
242
367
  </td></tr>
@@ -247,29 +372,40 @@ A function that disposes of a resource.
247
372
 
248
373
  </td><td>
249
374
 
250
- A function for retrieving the current value from a FlowObservable.
375
+ A function that retrieves the current value from a FlowObservable.
376
+
377
+
378
+ </td></tr>
379
+ <tr><td>
380
+
381
+ [FlowStreamDisposer](./picoflow.flowstreamdisposer.md)
382
+
383
+
384
+ </td><td>
385
+
386
+ A function type that disposes of a resource.
251
387
 
252
388
 
253
389
  </td></tr>
254
390
  <tr><td>
255
391
 
256
- [FlowSetter](./picoflow.flowsetter.md)
392
+ [FlowStreamSetter](./picoflow.flowstreamsetter.md)
257
393
 
258
394
 
259
395
  </td><td>
260
396
 
261
- A function that sets a new value.
397
+ A function type that sets a new value for the reactive stream.
262
398
 
263
399
 
264
400
  </td></tr>
265
401
  <tr><td>
266
402
 
267
- [FlowUpdater](./picoflow.flowupdater.md)
403
+ [FlowStreamUpdater](./picoflow.flowstreamupdater.md)
268
404
 
269
405
 
270
406
  </td><td>
271
407
 
272
- A function that performs updates on a stream.
408
+ A function type that updates a stream and returns a disposer for cleanup.
273
409
 
274
410
 
275
411
  </td></tr>
@@ -1,6 +1,6 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [picoflow](./picoflow.md) &gt; [resource](./picoflow.resource.md)
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [resource](./picoflow.resource.md)
4
4
 
5
5
  ## resource() function
6
6
 
@@ -9,7 +9,7 @@ Creates a new reactive resource that asynchronously fetches its value.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export declare function resource<T>(fn: () => Promise<T>, initial: T): FlowResource<T>;
12
+ export declare function resource<T>(fn: () => Promise<T>): FlowResource<T>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -45,22 +45,6 @@ fn
45
45
  An asynchronous function that fetches the resource value.
46
46
 
47
47
 
48
- </td></tr>
49
- <tr><td>
50
-
51
- initial
52
-
53
-
54
- </td><td>
55
-
56
- T
57
-
58
-
59
- </td><td>
60
-
61
- The initial value of the resource.
62
-
63
-
64
48
  </td></tr>
65
49
  </tbody></table>
66
50
  **Returns:**
@@ -0,0 +1,55 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [resourceAsync](./picoflow.resourceasync.md)
4
+
5
+ ## resourceAsync() function
6
+
7
+ Creates a new reactive asynchronous resource that fetches its value.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function resourceAsync<T>(fn: () => Promise<T>): FlowResourceAsync<T>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ fn
36
+
37
+
38
+ </td><td>
39
+
40
+ () =&gt; Promise&lt;T&gt;
41
+
42
+
43
+ </td><td>
44
+
45
+ An asynchronous function that fetches the resource value.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ [FlowResourceAsync](./picoflow.flowresourceasync.md)<!-- -->&lt;T&gt;
53
+
54
+ A new instance of [FlowResourceAsync](./picoflow.flowresourceasync.md)<!-- -->.
55
+
@@ -1,6 +1,6 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [picoflow](./picoflow.md) &gt; [signal](./picoflow.signal.md)
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [signal](./picoflow.signal.md)
4
4
 
5
5
  ## signal() function
6
6
 
@@ -1,6 +1,6 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [picoflow](./picoflow.md) &gt; [state](./picoflow.state.md)
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [state](./picoflow.state.md)
4
4
 
5
5
  ## state() function
6
6
 
@@ -9,7 +9,7 @@ Creates a new reactive state holding a value.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export declare function state<T>(value: T): FlowState<T>;
12
+ export declare function state<T>(value: T | (() => T)): FlowState<T>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -37,7 +37,7 @@ value
37
37
 
38
38
  </td><td>
39
39
 
40
- T
40
+ T \| (() =&gt; T)
41
41
 
42
42
 
43
43
  </td><td>
@@ -1,6 +1,6 @@
1
1
  <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
2
 
3
- [Home](./index.md) &gt; [picoflow](./picoflow.md) &gt; [stream](./picoflow.stream.md)
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [stream](./picoflow.stream.md)
4
4
 
5
5
  ## stream() function
6
6
 
@@ -9,7 +9,7 @@ Creates a new reactive stream.
9
9
  **Signature:**
10
10
 
11
11
  ```typescript
12
- export declare function stream<T>(updater: (set: (value: T) => void) => () => void, initial: T): FlowStream<T>;
12
+ export declare function stream<T>(updater: (set: (value: T) => void) => () => void): FlowStream<T>;
13
13
  ```
14
14
 
15
15
  ## Parameters
@@ -45,22 +45,6 @@ updater
45
45
  A function that receives a setter to update the stream's value. It should return a disposer function to clean up resources.
46
46
 
47
47
 
48
- </td></tr>
49
- <tr><td>
50
-
51
- initial
52
-
53
-
54
- </td><td>
55
-
56
- T
57
-
58
-
59
- </td><td>
60
-
61
- The initial value of the stream.
62
-
63
-
64
48
  </td></tr>
65
49
  </tbody></table>
66
50
  **Returns:**
@@ -0,0 +1,55 @@
1
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
2
+
3
+ [Home](./index.md) &gt; [@ersbeth/picoflow](./picoflow.md) &gt; [streamAsync](./picoflow.streamasync.md)
4
+
5
+ ## streamAsync() function
6
+
7
+ Creates a new reactive asynchronous stream.
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ export declare function streamAsync<T>(updater: (set: (value: T) => void) => () => void): FlowStreamAsync<T>;
13
+ ```
14
+
15
+ ## Parameters
16
+
17
+ <table><thead><tr><th>
18
+
19
+ Parameter
20
+
21
+
22
+ </th><th>
23
+
24
+ Type
25
+
26
+
27
+ </th><th>
28
+
29
+ Description
30
+
31
+
32
+ </th></tr></thead>
33
+ <tbody><tr><td>
34
+
35
+ updater
36
+
37
+
38
+ </td><td>
39
+
40
+ (set: (value: T) =&gt; void) =&gt; () =&gt; void
41
+
42
+
43
+ </td><td>
44
+
45
+ A function that receives a setter to update the stream's value. It should return a disposer function to clean up resources.
46
+
47
+
48
+ </td></tr>
49
+ </tbody></table>
50
+ **Returns:**
51
+
52
+ [FlowStreamAsync](./picoflow.flowstreamasync.md)<!-- -->&lt;T&gt;
53
+
54
+ A new instance of [FlowStreamAsync](./picoflow.flowstreamasync.md)<!-- -->.
55
+
@@ -0,0 +1,192 @@
1
+ ## Public API Report File for "@ersbeth/picoflow"
2
+
3
+ > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).
4
+
5
+ ```ts
6
+
7
+ // @public
8
+ export function array<T>(initial?: T[]): FlowArray<T>;
9
+
10
+ // @public
11
+ export function constant<T>(value: T | (() => T)): FlowConstant<T>;
12
+
13
+ // @public
14
+ export function derivation<T>(fn: (get: FlowGetter, watch: FlowWatcher) => T): FlowDerivation<T>;
15
+
16
+ // @public
17
+ export function effect(fn: (get: FlowGetter, watch: FlowWatcher) => void): FlowEffect;
18
+
19
+ // @public
20
+ export class FlowArray<T> extends FlowObservable<T[]> {
21
+ $lastAction: FlowState<FlowArrayAction<T>>;
22
+ constructor(value?: T[]);
23
+ clear(): void;
24
+ dispose(options?: {
25
+ self: boolean;
26
+ }): void;
27
+ get(): T[];
28
+ get length(): number;
29
+ pop(): void;
30
+ push(item: T): void;
31
+ set(items: T[]): void;
32
+ setItem(index: number, item: T): void;
33
+ shift(): void;
34
+ splice(start: number, deleteCount: number, ...newItems: T[]): void;
35
+ unshift(item: T): void;
36
+ }
37
+
38
+ // @public
39
+ export type FlowArrayAction<T> = {
40
+ type: "set";
41
+ items: T[];
42
+ } | {
43
+ type: "setItem";
44
+ index: number;
45
+ item: T;
46
+ } | {
47
+ type: "push";
48
+ item: T;
49
+ } | {
50
+ type: "pop";
51
+ } | {
52
+ type: "unshift";
53
+ item: T;
54
+ } | {
55
+ type: "shift";
56
+ } | {
57
+ type: "splice";
58
+ start: number;
59
+ deleteCount: number;
60
+ items: T[];
61
+ } | {
62
+ type: "clear";
63
+ };
64
+
65
+ // @public
66
+ export class FlowConstant<T> extends FlowObservable<T> {
67
+ constructor(value: T | (() => T));
68
+ get(): T;
69
+ }
70
+
71
+ // @public
72
+ export class FlowDerivation<T> extends FlowObservable<T> {
73
+ constructor(compute: (get: FlowGetter, watch: FlowWatcher) => T);
74
+ get(): T;
75
+ }
76
+
77
+ // @public
78
+ export interface FlowDisposable {
79
+ dispose(options?: {
80
+ self: boolean;
81
+ }): void;
82
+ }
83
+
84
+ // @public
85
+ export class FlowEffect {
86
+ constructor(apply: (get: FlowGetter, watch: FlowWatcher) => void);
87
+ dispose(): void;
88
+ get disposed(): boolean;
89
+ }
90
+
91
+ // @public
92
+ export type FlowGetter = <T>(observable: FlowObservable<T>) => T;
93
+
94
+ // @public
95
+ export class FlowMap<K, V> extends FlowState<Map<K, V>> {
96
+ $lastDeleted: FlowState<{
97
+ key?: K;
98
+ value?: V;
99
+ }>;
100
+ $lastSet: FlowState<{
101
+ key?: K;
102
+ value?: V;
103
+ }>;
104
+ delete(key: K): void;
105
+ setAt(key: K, value: V): void;
106
+ }
107
+
108
+ // @public
109
+ export abstract class FlowObservable<T> extends FlowSignal {
110
+ abstract get(): T;
111
+ subscribe(listener: (value: T) => void): () => void;
112
+ }
113
+
114
+ // @public
115
+ export class FlowResource<T> extends FlowObservable<T | undefined> {
116
+ constructor(fetch: () => Promise<T>);
117
+ fetch(): Promise<void>;
118
+ get(): T | undefined;
119
+ }
120
+
121
+ // @public
122
+ export class FlowResourceAsync<T> extends FlowObservable<Promise<T>> {
123
+ constructor(fetch: () => Promise<T>);
124
+ fetch(): Promise<void>;
125
+ get(): Promise<T>;
126
+ }
127
+
128
+ // @public
129
+ export class FlowSignal implements FlowDisposable {
130
+ dispose(options?: {
131
+ self: boolean;
132
+ }): void;
133
+ get disposed(): boolean;
134
+ trigger(): void;
135
+ }
136
+
137
+ // @public
138
+ export class FlowState<T> extends FlowConstant<T> {
139
+ set(value: T | ((current: T) => T)): void;
140
+ }
141
+
142
+ // @public
143
+ export class FlowStream<T> extends FlowObservable<T | undefined> {
144
+ constructor(updater: FlowStreamUpdater<T>);
145
+ dispose(): void;
146
+ get(): T | undefined;
147
+ }
148
+
149
+ // @public
150
+ export class FlowStreamAsync<T> extends FlowObservable<Promise<T>> {
151
+ constructor(updater: FlowStreamUpdater<T>);
152
+ dispose(): void;
153
+ get(): Promise<T>;
154
+ }
155
+
156
+ // @public
157
+ export type FlowStreamDisposer = () => void;
158
+
159
+ // @public
160
+ export type FlowStreamSetter<T> = (value: T) => void;
161
+
162
+ // @public
163
+ export type FlowStreamUpdater<T> = (set: FlowStreamSetter<T>) => FlowStreamDisposer;
164
+
165
+ // @public
166
+ export type FlowWatcher = (signal: FlowSignal) => void;
167
+
168
+ // @public
169
+ export function isDisposable(obj: unknown): obj is FlowDisposable;
170
+
171
+ // @public
172
+ export function map<K extends string | number | symbol, V>(initial?: Record<K, V>): FlowMap<K, V>;
173
+
174
+ // @public
175
+ export function resource<T>(fn: () => Promise<T>): FlowResource<T>;
176
+
177
+ // @public
178
+ export function resourceAsync<T>(fn: () => Promise<T>): FlowResourceAsync<T>;
179
+
180
+ // @public
181
+ export function signal(): FlowSignal;
182
+
183
+ // @public
184
+ export function state<T>(value: T | (() => T)): FlowState<T>;
185
+
186
+ // @public
187
+ export function stream<T>(updater: (set: (value: T) => void) => () => void): FlowStream<T>;
188
+
189
+ // @public
190
+ export function streamAsync<T>(updater: (set: (value: T) => void) => () => void): FlowStreamAsync<T>;
191
+
192
+ ```
@@ -6,7 +6,8 @@
6
6
  "apiReport": {
7
7
  "enabled": true,
8
8
  "reportFolder": "<projectFolder>/api/",
9
- "reportTempFolder": "<projectFolder>/api/temp/"
9
+ "reportTempFolder": "<projectFolder>/api/temp/",
10
+ "reportVariants": ["public"]
10
11
  },
11
12
 
12
13
  "docModel": {