@ersbeth/picoflow 0.2.4 → 1.0.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.
Files changed (248) hide show
  1. package/.cursor/plans/update-js-e795d61b.plan.md +567 -0
  2. package/.gitlab-ci.yml +24 -0
  3. package/.vscode/settings.json +3 -3
  4. package/CHANGELOG.md +51 -0
  5. package/IMPLEMENTATION_GUIDE.md +1578 -0
  6. package/README.md +9 -134
  7. package/biome.json +32 -32
  8. package/dist/picoflow.js +610 -436
  9. package/dist/types/advanced/array.d.ts +0 -6
  10. package/dist/types/advanced/array.d.ts.map +1 -1
  11. package/dist/types/advanced/index.d.ts +5 -5
  12. package/dist/types/advanced/index.d.ts.map +1 -1
  13. package/dist/types/advanced/map.d.ts +114 -23
  14. package/dist/types/advanced/map.d.ts.map +1 -1
  15. package/dist/types/advanced/resource.d.ts +51 -12
  16. package/dist/types/advanced/resource.d.ts.map +1 -1
  17. package/dist/types/advanced/resourceAsync.d.ts +28 -13
  18. package/dist/types/advanced/resourceAsync.d.ts.map +1 -1
  19. package/dist/types/advanced/stream.d.ts +74 -16
  20. package/dist/types/advanced/stream.d.ts.map +1 -1
  21. package/dist/types/advanced/streamAsync.d.ts +69 -15
  22. package/dist/types/advanced/streamAsync.d.ts.map +1 -1
  23. package/dist/types/basic/constant.d.ts +44 -16
  24. package/dist/types/basic/constant.d.ts.map +1 -1
  25. package/dist/types/basic/derivation.d.ts +73 -24
  26. package/dist/types/basic/derivation.d.ts.map +1 -1
  27. package/dist/types/basic/disposable.d.ts +65 -6
  28. package/dist/types/basic/disposable.d.ts.map +1 -1
  29. package/dist/types/basic/effect.d.ts +27 -16
  30. package/dist/types/basic/effect.d.ts.map +1 -1
  31. package/dist/types/basic/index.d.ts +7 -8
  32. package/dist/types/basic/index.d.ts.map +1 -1
  33. package/dist/types/basic/observable.d.ts +62 -13
  34. package/dist/types/basic/observable.d.ts.map +1 -1
  35. package/dist/types/basic/signal.d.ts +35 -6
  36. package/dist/types/basic/signal.d.ts.map +1 -1
  37. package/dist/types/basic/state.d.ts +25 -4
  38. package/dist/types/basic/state.d.ts.map +1 -1
  39. package/dist/types/basic/trackingContext.d.ts +33 -0
  40. package/dist/types/basic/trackingContext.d.ts.map +1 -0
  41. package/dist/types/creators.d.ts +271 -26
  42. package/dist/types/creators.d.ts.map +1 -1
  43. package/dist/types/index.d.ts +60 -7
  44. package/dist/types/index.d.ts.map +1 -1
  45. package/dist/types/solid/converters.d.ts +5 -5
  46. package/dist/types/solid/converters.d.ts.map +1 -1
  47. package/dist/types/solid/index.d.ts +2 -2
  48. package/dist/types/solid/index.d.ts.map +1 -1
  49. package/dist/types/solid/primitives.d.ts +96 -4
  50. package/dist/types/solid/primitives.d.ts.map +1 -1
  51. package/docs/.vitepress/config.mts +110 -0
  52. package/docs/api/classes/FlowArray.md +489 -0
  53. package/docs/api/classes/FlowConstant.md +350 -0
  54. package/docs/api/classes/FlowDerivation.md +334 -0
  55. package/docs/api/classes/FlowEffect.md +100 -0
  56. package/docs/api/classes/FlowMap.md +512 -0
  57. package/docs/api/classes/FlowObservable.md +306 -0
  58. package/docs/api/classes/FlowResource.md +380 -0
  59. package/docs/api/classes/FlowResourceAsync.md +362 -0
  60. package/docs/api/classes/FlowSignal.md +160 -0
  61. package/docs/api/classes/FlowState.md +368 -0
  62. package/docs/api/classes/FlowStream.md +367 -0
  63. package/docs/api/classes/FlowStreamAsync.md +364 -0
  64. package/docs/api/classes/SolidDerivation.md +75 -0
  65. package/docs/api/classes/SolidResource.md +91 -0
  66. package/docs/api/classes/SolidState.md +71 -0
  67. package/docs/api/classes/TrackingContext.md +33 -0
  68. package/docs/api/functions/array.md +58 -0
  69. package/docs/api/functions/constant.md +45 -0
  70. package/docs/api/functions/derivation.md +53 -0
  71. package/docs/api/functions/effect.md +49 -0
  72. package/docs/api/functions/from.md +220 -0
  73. package/docs/api/functions/isDisposable.md +49 -0
  74. package/docs/api/functions/map.md +57 -0
  75. package/docs/api/functions/resource.md +52 -0
  76. package/docs/api/functions/resourceAsync.md +50 -0
  77. package/docs/api/functions/signal.md +36 -0
  78. package/docs/api/functions/state.md +47 -0
  79. package/docs/api/functions/stream.md +53 -0
  80. package/docs/api/functions/streamAsync.md +50 -0
  81. package/docs/api/index.md +118 -0
  82. package/docs/api/interfaces/FlowDisposable.md +65 -0
  83. package/docs/api/interfaces/SolidObservable.md +19 -0
  84. package/docs/api/type-aliases/FlowArrayAction.md +49 -0
  85. package/docs/api/type-aliases/FlowStreamDisposer.md +15 -0
  86. package/docs/api/type-aliases/FlowStreamSetter.md +27 -0
  87. package/docs/api/type-aliases/FlowStreamUpdater.md +32 -0
  88. package/docs/api/type-aliases/NotPromise.md +18 -0
  89. package/docs/api/type-aliases/SolidGetter.md +17 -0
  90. package/docs/api/typedoc-sidebar.json +1 -0
  91. package/docs/examples/examples.md +2313 -0
  92. package/docs/examples/patterns.md +649 -0
  93. package/docs/guide/advanced/disposal.md +426 -0
  94. package/docs/guide/advanced/solidjs.md +221 -0
  95. package/docs/guide/advanced/upgrading.md +464 -0
  96. package/docs/guide/introduction/concepts.md +56 -0
  97. package/docs/guide/introduction/conventions.md +61 -0
  98. package/docs/guide/introduction/getting-started.md +134 -0
  99. package/docs/guide/introduction/lifecycle.md +371 -0
  100. package/docs/guide/primitives/array.md +400 -0
  101. package/docs/guide/primitives/constant.md +380 -0
  102. package/docs/guide/primitives/derivations.md +348 -0
  103. package/docs/guide/primitives/effects.md +458 -0
  104. package/docs/guide/primitives/map.md +387 -0
  105. package/docs/guide/primitives/overview.md +175 -0
  106. package/docs/guide/primitives/resources.md +858 -0
  107. package/docs/guide/primitives/signal.md +259 -0
  108. package/docs/guide/primitives/state.md +368 -0
  109. package/docs/guide/primitives/streams.md +931 -0
  110. package/docs/index.md +47 -0
  111. package/docs/public/logo.svg +1 -0
  112. package/package.json +57 -41
  113. package/src/advanced/array.ts +208 -210
  114. package/src/advanced/index.ts +7 -7
  115. package/src/advanced/map.ts +178 -68
  116. package/src/advanced/resource.ts +87 -43
  117. package/src/advanced/resourceAsync.ts +62 -42
  118. package/src/advanced/stream.ts +113 -50
  119. package/src/advanced/streamAsync.ts +120 -61
  120. package/src/basic/constant.ts +82 -49
  121. package/src/basic/derivation.ts +128 -84
  122. package/src/basic/disposable.ts +74 -15
  123. package/src/basic/effect.ts +85 -77
  124. package/src/basic/index.ts +7 -8
  125. package/src/basic/observable.ts +94 -36
  126. package/src/basic/signal.ts +133 -105
  127. package/src/basic/state.ts +46 -25
  128. package/src/basic/trackingContext.ts +45 -0
  129. package/src/creators.ts +297 -54
  130. package/src/index.ts +96 -43
  131. package/src/solid/converters.ts +186 -67
  132. package/src/solid/index.ts +8 -2
  133. package/src/solid/primitives.ts +167 -65
  134. package/test/array.test.ts +592 -612
  135. package/test/constant.test.ts +31 -33
  136. package/test/derivation.test.ts +531 -536
  137. package/test/effect.test.ts +21 -21
  138. package/test/map.test.ts +233 -137
  139. package/test/resource.test.ts +119 -121
  140. package/test/resourceAsync.test.ts +98 -100
  141. package/test/signal.test.ts +51 -55
  142. package/test/state.test.ts +186 -168
  143. package/test/stream.test.ts +189 -189
  144. package/test/streamAsync.test.ts +186 -186
  145. package/tsconfig.json +19 -18
  146. package/typedoc.json +37 -0
  147. package/vite.config.ts +23 -23
  148. package/vitest.config.ts +7 -7
  149. package/api/doc/index.md +0 -31
  150. package/api/doc/picoflow.array.md +0 -55
  151. package/api/doc/picoflow.constant.md +0 -55
  152. package/api/doc/picoflow.derivation.md +0 -55
  153. package/api/doc/picoflow.effect.md +0 -55
  154. package/api/doc/picoflow.flowarray._constructor_.md +0 -49
  155. package/api/doc/picoflow.flowarray._lastaction.md +0 -13
  156. package/api/doc/picoflow.flowarray.clear.md +0 -17
  157. package/api/doc/picoflow.flowarray.dispose.md +0 -55
  158. package/api/doc/picoflow.flowarray.get.md +0 -19
  159. package/api/doc/picoflow.flowarray.length.md +0 -13
  160. package/api/doc/picoflow.flowarray.md +0 -273
  161. package/api/doc/picoflow.flowarray.pop.md +0 -17
  162. package/api/doc/picoflow.flowarray.push.md +0 -53
  163. package/api/doc/picoflow.flowarray.set.md +0 -53
  164. package/api/doc/picoflow.flowarray.setitem.md +0 -69
  165. package/api/doc/picoflow.flowarray.shift.md +0 -17
  166. package/api/doc/picoflow.flowarray.splice.md +0 -85
  167. package/api/doc/picoflow.flowarray.unshift.md +0 -53
  168. package/api/doc/picoflow.flowarrayaction.md +0 -37
  169. package/api/doc/picoflow.flowconstant._constructor_.md +0 -49
  170. package/api/doc/picoflow.flowconstant.get.md +0 -25
  171. package/api/doc/picoflow.flowconstant.md +0 -88
  172. package/api/doc/picoflow.flowderivation._constructor_.md +0 -49
  173. package/api/doc/picoflow.flowderivation.get.md +0 -23
  174. package/api/doc/picoflow.flowderivation.md +0 -86
  175. package/api/doc/picoflow.flowdisposable.dispose.md +0 -55
  176. package/api/doc/picoflow.flowdisposable.md +0 -43
  177. package/api/doc/picoflow.floweffect._constructor_.md +0 -54
  178. package/api/doc/picoflow.floweffect.dispose.md +0 -21
  179. package/api/doc/picoflow.floweffect.disposed.md +0 -13
  180. package/api/doc/picoflow.floweffect.md +0 -131
  181. package/api/doc/picoflow.flowgetter.md +0 -15
  182. package/api/doc/picoflow.flowmap._lastdeleted.md +0 -21
  183. package/api/doc/picoflow.flowmap._lastset.md +0 -21
  184. package/api/doc/picoflow.flowmap.delete.md +0 -61
  185. package/api/doc/picoflow.flowmap.md +0 -133
  186. package/api/doc/picoflow.flowmap.setat.md +0 -77
  187. package/api/doc/picoflow.flowobservable.get.md +0 -19
  188. package/api/doc/picoflow.flowobservable.md +0 -68
  189. package/api/doc/picoflow.flowobservable.subscribe.md +0 -55
  190. package/api/doc/picoflow.flowresource._constructor_.md +0 -49
  191. package/api/doc/picoflow.flowresource.fetch.md +0 -27
  192. package/api/doc/picoflow.flowresource.get.md +0 -23
  193. package/api/doc/picoflow.flowresource.md +0 -100
  194. package/api/doc/picoflow.flowresourceasync._constructor_.md +0 -49
  195. package/api/doc/picoflow.flowresourceasync.fetch.md +0 -27
  196. package/api/doc/picoflow.flowresourceasync.get.md +0 -23
  197. package/api/doc/picoflow.flowresourceasync.md +0 -100
  198. package/api/doc/picoflow.flowsignal.dispose.md +0 -59
  199. package/api/doc/picoflow.flowsignal.disposed.md +0 -18
  200. package/api/doc/picoflow.flowsignal.md +0 -112
  201. package/api/doc/picoflow.flowsignal.trigger.md +0 -21
  202. package/api/doc/picoflow.flowstate.md +0 -52
  203. package/api/doc/picoflow.flowstate.set.md +0 -61
  204. package/api/doc/picoflow.flowstream._constructor_.md +0 -49
  205. package/api/doc/picoflow.flowstream.dispose.md +0 -21
  206. package/api/doc/picoflow.flowstream.get.md +0 -23
  207. package/api/doc/picoflow.flowstream.md +0 -100
  208. package/api/doc/picoflow.flowstreamasync._constructor_.md +0 -54
  209. package/api/doc/picoflow.flowstreamasync.dispose.md +0 -21
  210. package/api/doc/picoflow.flowstreamasync.get.md +0 -23
  211. package/api/doc/picoflow.flowstreamasync.md +0 -100
  212. package/api/doc/picoflow.flowstreamdisposer.md +0 -13
  213. package/api/doc/picoflow.flowstreamsetter.md +0 -13
  214. package/api/doc/picoflow.flowstreamupdater.md +0 -19
  215. package/api/doc/picoflow.flowwatcher.md +0 -15
  216. package/api/doc/picoflow.from.md +0 -55
  217. package/api/doc/picoflow.from_1.md +0 -55
  218. package/api/doc/picoflow.from_2.md +0 -55
  219. package/api/doc/picoflow.from_3.md +0 -55
  220. package/api/doc/picoflow.from_4.md +0 -55
  221. package/api/doc/picoflow.from_5.md +0 -55
  222. package/api/doc/picoflow.isdisposable.md +0 -55
  223. package/api/doc/picoflow.map.md +0 -59
  224. package/api/doc/picoflow.md +0 -544
  225. package/api/doc/picoflow.resource.md +0 -55
  226. package/api/doc/picoflow.resourceasync.md +0 -55
  227. package/api/doc/picoflow.signal.md +0 -19
  228. package/api/doc/picoflow.solidderivation._constructor_.md +0 -49
  229. package/api/doc/picoflow.solidderivation.get.md +0 -13
  230. package/api/doc/picoflow.solidderivation.md +0 -94
  231. package/api/doc/picoflow.solidgetter.md +0 -13
  232. package/api/doc/picoflow.solidobservable.get.md +0 -13
  233. package/api/doc/picoflow.solidobservable.md +0 -57
  234. package/api/doc/picoflow.solidresource._constructor_.md +0 -49
  235. package/api/doc/picoflow.solidresource.get.md +0 -13
  236. package/api/doc/picoflow.solidresource.latest.md +0 -13
  237. package/api/doc/picoflow.solidresource.md +0 -157
  238. package/api/doc/picoflow.solidresource.refetch.md +0 -13
  239. package/api/doc/picoflow.solidresource.state.md +0 -13
  240. package/api/doc/picoflow.solidstate._constructor_.md +0 -49
  241. package/api/doc/picoflow.solidstate.get.md +0 -13
  242. package/api/doc/picoflow.solidstate.md +0 -115
  243. package/api/doc/picoflow.solidstate.set.md +0 -13
  244. package/api/doc/picoflow.state.md +0 -55
  245. package/api/doc/picoflow.stream.md +0 -55
  246. package/api/doc/picoflow.streamasync.md +0 -55
  247. package/api/picoflow.public.api.md +0 -244
  248. package/api-extractor.json +0 -61
@@ -0,0 +1,53 @@
1
+ [@ersbeth/picoflow](/api/index.md) / stream
2
+
3
+ # Function: stream()
4
+
5
+ ```ts
6
+ function stream<T>(updater): FlowStream<T>;
7
+ ```
8
+
9
+ Defined in: [creators.ts:200](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/creators.ts#L200)
10
+
11
+ Creates a new reactive stream that bridges external event sources with PicoFlow's reactive system.
12
+
13
+ ## Type Parameters
14
+
15
+ | Type Parameter | Description |
16
+ | ------ | ------ |
17
+ | `T` | The type of the stream value. |
18
+
19
+ ## Parameters
20
+
21
+ | Parameter | Type | Description |
22
+ | ------ | ------ | ------ |
23
+ | `updater` | (`set`) => () => `void` | A function that receives a setter to update the stream's value. It should return a disposer function to clean up resources. |
24
+
25
+ ## Returns
26
+
27
+ [`FlowStream`](/api/classes/FlowStream.md)\<`T`\>
28
+
29
+ A new instance of [FlowStream](/api/classes/FlowStream.md).
30
+
31
+ ## Remarks
32
+
33
+ Streams are ideal for integrating push-based data sources like WebSockets, DOM events,
34
+ timers, or any event emitter. The updater sets up subscriptions and calls the setter
35
+ when new data arrives. The returned disposer is called on cleanup.
36
+
37
+ ## Example
38
+
39
+ ```typescript
40
+ // WebSocket stream
41
+ const $messages = stream<string>((set) => {
42
+ const ws = new WebSocket('ws://example.com');
43
+ ws.onmessage = (e) => set(e.data);
44
+ return () => ws.close();
45
+ });
46
+
47
+ // Timer stream
48
+ const $tick = stream<number>((set) => {
49
+ let count = 0;
50
+ const id = setInterval(() => set(count++), 1000);
51
+ return () => clearInterval(id);
52
+ });
53
+ ```
@@ -0,0 +1,50 @@
1
+ [@ersbeth/picoflow](/api/index.md) / streamAsync
2
+
3
+ # Function: streamAsync()
4
+
5
+ ```ts
6
+ function streamAsync<T>(updater): FlowStreamAsync<T>;
7
+ ```
8
+
9
+ Defined in: [creators.ts:235](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/creators.ts#L235)
10
+
11
+ Creates a new reactive asynchronous stream that always returns a Promise.
12
+
13
+ ## Type Parameters
14
+
15
+ | Type Parameter | Description |
16
+ | ------ | ------ |
17
+ | `T` | The type of the stream value. |
18
+
19
+ ## Parameters
20
+
21
+ | Parameter | Type | Description |
22
+ | ------ | ------ | ------ |
23
+ | `updater` | (`set`) => () => `void` | A function that receives a setter to update the stream's value. It should return a disposer function to clean up resources. |
24
+
25
+ ## Returns
26
+
27
+ [`FlowStreamAsync`](/api/classes/FlowStreamAsync.md)\<`T`\>
28
+
29
+ A new instance of [FlowStreamAsync](/api/classes/FlowStreamAsync.md).
30
+
31
+ ## Remarks
32
+
33
+ Async streams are ideal for push-based async data sources where you want to use async/await.
34
+ Unlike [stream](/api/functions/stream.md), this always returns a Promise that resolves to the value. The initial
35
+ Promise is created on construction and resolves when the setter is first called.
36
+
37
+ ## Example
38
+
39
+ ```typescript
40
+ const $asyncMessages = streamAsync<string>((set) => {
41
+ const ws = new WebSocket('ws://example.com');
42
+ ws.onmessage = (e) => set(e.data);
43
+ return () => ws.close();
44
+ });
45
+
46
+ effect(async (t) => {
47
+ const message = await $asyncMessages.get(t);
48
+ console.log('Received:', message);
49
+ });
50
+ ```
@@ -0,0 +1,118 @@
1
+ # @ersbeth/picoflow
2
+
3
+ # PicoFlow
4
+
5
+ PicoFlow is a lightweight reactive dataflow library that provides a comprehensive set of
6
+ reactive primitives for building reactive applications with explicit dependency tracking.
7
+
8
+ ## Core Concepts
9
+
10
+ **Reactive Primitives:**
11
+ - [FlowSignal](/api/classes/FlowSignal.md): Event-like notifications without values
12
+ - [FlowState](/api/classes/FlowState.md): Mutable reactive values
13
+ - [FlowConstant](/api/classes/FlowConstant.md): Immutable reactive values (computed once)
14
+ - [FlowDerivation](/api/classes/FlowDerivation.md): Computed values that track dependencies
15
+ - [FlowEffect](/api/classes/FlowEffect.md): Side effects that run when dependencies change
16
+
17
+ **Advanced Primitives:**
18
+ - [FlowArray](/api/classes/FlowArray.md): Reactive arrays with mutation tracking
19
+ - [FlowMap](/api/classes/FlowMap.md): Reactive maps with operation tracking
20
+ - [FlowResource](/api/classes/FlowResource.md): Async data fetching returning `T | undefined`
21
+ - [FlowResourceAsync](/api/classes/FlowResourceAsync.md): Async data fetching returning `Promise<T>`
22
+ - [FlowStream](/api/classes/FlowStream.md): Event streams from external sources
23
+ - [FlowStreamAsync](/api/classes/FlowStreamAsync.md): Async event streams returning Promises
24
+
25
+ **Tracking Context:**
26
+ - [TrackingContext](/api/classes/TrackingContext.md): The core mechanism for explicit dependency tracking
27
+ - Use `observable.get(t)` to read with tracking
28
+ - Use `observable.pick()` to read without tracking
29
+ - Use `signal.watch(t)` to track signals without values
30
+
31
+ ## Key Features
32
+
33
+ - **Explicit tracking**: Full control over what triggers re-execution via TrackingContext
34
+ - **Lazy evaluation**: Derivations compute only when accessed
35
+ - **Fine-grained reactivity**: Track specific operations on collections
36
+ - **Resource management**: Automatic cleanup with dispose patterns
37
+ - **SolidJS integration**: Seamless bridge to SolidJS primitives
38
+
39
+ ## Basic Usage
40
+
41
+ ```typescript
42
+ import { state, effect, derivation } from 'picoflow';
43
+
44
+ // Create reactive state
45
+ const $count = state(0);
46
+
47
+ // Create derived value
48
+ const $double = derivation((t) => $count.get(t) * 2);
49
+
50
+ // Create effect
51
+ effect((t) => {
52
+ console.log('Count:', $count.get(t), 'Double:', $double.get(t));
53
+ });
54
+
55
+ // Update state
56
+ $count.set(1); // Logs: "Count: 1 Double: 2"
57
+ ```
58
+
59
+ ## See
60
+
61
+ [GitHub Repository](https://github.com/yourusername/picoflow)
62
+
63
+ ## Classes
64
+
65
+ | Class | Description |
66
+ | ------ | ------ |
67
+ | [FlowArray](/api/classes/FlowArray.md) | Represents a reactive array. |
68
+ | [FlowConstant](/api/classes/FlowConstant.md) | Represents a reactive and immutable constant value that can be computed lazily upon first access. |
69
+ | [FlowDerivation](/api/classes/FlowDerivation.md) | Represents a reactive derivation whose value is computed based on other reactive signals. |
70
+ | [FlowEffect](/api/classes/FlowEffect.md) | Represents a reactive effect that executes side-effect functions based on its tracked dependencies. |
71
+ | [FlowMap](/api/classes/FlowMap.md) | Represents a reactive map that extends [FlowState](/api/classes/FlowState.md) for tracking key-value pairs. |
72
+ | [FlowObservable](/api/classes/FlowObservable.md) | Represents a reactive observable that holds and tracks a value. |
73
+ | [FlowResource](/api/classes/FlowResource.md) | Represents a reactive resource that asynchronously fetches its value and returns `T | undefined`. |
74
+ | [FlowResourceAsync](/api/classes/FlowResourceAsync.md) | Represents a reactive resource that asynchronously fetches its value and always returns a Promise. |
75
+ | [FlowSignal](/api/classes/FlowSignal.md) | Represents a reactive signal. |
76
+ | [FlowState](/api/classes/FlowState.md) | Represents a reactive state that holds a mutable value. |
77
+ | [FlowStream](/api/classes/FlowStream.md) | Represents a reactive stream that updates its value based on an external updater function. |
78
+ | [FlowStreamAsync](/api/classes/FlowStreamAsync.md) | Represents an asynchronous reactive stream that always returns a Promise and updates based on an updater function. |
79
+ | [SolidDerivation](/api/classes/SolidDerivation.md) | Solid-style derivation wrapping SolidJS's createMemo, providing a computed reactive value. |
80
+ | [SolidResource](/api/classes/SolidResource.md) | Solid-style resource wrapping SolidJS's createResource, providing async data loading with reactive state. |
81
+ | [SolidState](/api/classes/SolidState.md) | Solid-style state container wrapping SolidJS's createSignal, providing a writable reactive signal. |
82
+ | [TrackingContext](/api/classes/TrackingContext.md) | Represents a tracking context used to register dependencies during reactive computations. |
83
+
84
+ ## Interfaces
85
+
86
+ | Interface | Description |
87
+ | ------ | ------ |
88
+ | [FlowDisposable](/api/interfaces/FlowDisposable.md) | Represents an object with a disposable lifecycle that manages resources requiring cleanup. |
89
+ | [SolidObservable](/api/interfaces/SolidObservable.md) | Interface for a Solid-style observable value. |
90
+
91
+ ## Type Aliases
92
+
93
+ | Type Alias | Description |
94
+ | ------ | ------ |
95
+ | [FlowArrayAction](/api/type-aliases/FlowArrayAction.md) | Represents the actions that can be performed on a FlowArray. |
96
+ | [FlowStreamDisposer](/api/type-aliases/FlowStreamDisposer.md) | A function type that disposes of a resource. |
97
+ | [FlowStreamSetter](/api/type-aliases/FlowStreamSetter.md) | A function type that sets a new value for the reactive stream. |
98
+ | [FlowStreamUpdater](/api/type-aliases/FlowStreamUpdater.md) | A function type that updates a stream and returns a disposer for cleanup. |
99
+ | [NotPromise](/api/type-aliases/NotPromise.md) | Utility type that excludes Promise types from T. Used to ensure type safety for synchronous derivations/resources. |
100
+ | [SolidGetter](/api/type-aliases/SolidGetter.md) | A getter function or value for Solid state/derivation. |
101
+
102
+ ## Functions
103
+
104
+ | Function | Description |
105
+ | ------ | ------ |
106
+ | [array](/api/functions/array.md) | Creates a new reactive array with mutation methods and fine-grained action tracking. |
107
+ | [constant](/api/functions/constant.md) | Creates a new reactive constant. |
108
+ | [derivation](/api/functions/derivation.md) | Creates a new reactive derivation whose value is computed based on other reactive signals. |
109
+ | [effect](/api/functions/effect.md) | Creates a new reactive effect that executes a side-effect function based on its dependencies. |
110
+ | [from](/api/functions/from.md) | Converts a FlowObservable or getter function into a Solid derivation or resource, depending on whether the value is synchronous or asynchronous. |
111
+ | [isDisposable](/api/functions/isDisposable.md) | Type guard that checks whether an object implements the FlowDisposable interface. |
112
+ | [map](/api/functions/map.md) | Creates a new reactive map state with fine-grained tracking of operations. |
113
+ | [resource](/api/functions/resource.md) | Creates a new reactive resource that asynchronously fetches its value, returning `T | undefined`. |
114
+ | [resourceAsync](/api/functions/resourceAsync.md) | Creates a new reactive asynchronous resource that always returns a Promise. |
115
+ | [signal](/api/functions/signal.md) | Creates a new reactive signal. |
116
+ | [state](/api/functions/state.md) | Creates a new reactive state holding a mutable value. |
117
+ | [stream](/api/functions/stream.md) | Creates a new reactive stream that bridges external event sources with PicoFlow's reactive system. |
118
+ | [streamAsync](/api/functions/streamAsync.md) | Creates a new reactive asynchronous stream that always returns a Promise. |
@@ -0,0 +1,65 @@
1
+ [@ersbeth/picoflow](/api/index.md) / FlowDisposable
2
+
3
+ # Interface: FlowDisposable
4
+
5
+ Defined in: [basic/disposable.ts:35](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/basic/disposable.ts#L35)
6
+
7
+ Represents an object with a disposable lifecycle that manages resources requiring cleanup.
8
+
9
+ ## Remarks
10
+
11
+ FlowDisposable is the interface for PicoFlow primitives that hold resources needing
12
+ explicit cleanup. Implementing this interface ensures that objects can properly release
13
+ resources such as subscriptions, event listeners, and dependent effects.
14
+
15
+ **Disposal Behavior:**
16
+ All PicoFlow reactive primitives (signals, states, effects, derivations, etc.) implement
17
+ this interface. When disposed:
18
+ - The primitive becomes unusable and throws errors on further access
19
+ - All subscriptions and dependencies are cleaned up
20
+ - Memory is freed for garbage collection
21
+
22
+ **Options:**
23
+ The optional `options` parameter controls disposal behavior:
24
+ - `{ self: true }`: Dispose only this object, leaving dependent effects/listeners active
25
+ - `{ self: false }` or omitted: Dispose this object AND all dependent effects/listeners (cascade)
26
+
27
+ ## Example
28
+
29
+ ```typescript
30
+ const $state = state(0);
31
+ const fx = effect((t) => console.log($state.get(t)));
32
+
33
+ // Cascade disposal - disposes $state and all its effects
34
+ $state.dispose();
35
+
36
+ // Self-only disposal - disposes $state but leaves effects intact
37
+ $state.dispose({ self: true });
38
+ ```
39
+
40
+ ## Methods
41
+
42
+ ### dispose()
43
+
44
+ ```ts
45
+ dispose(options?): void;
46
+ ```
47
+
48
+ Defined in: [basic/disposable.ts:45](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/basic/disposable.ts#L45)
49
+
50
+ Disposes resources held by this object.
51
+
52
+ #### Parameters
53
+
54
+ | Parameter | Type | Description |
55
+ | ------ | ------ | ------ |
56
+ | `options?` | \{ `self`: `boolean`; \} | Optional configuration for disposal behavior. |
57
+ | `options.self?` | `boolean` | When true, disposes only this object without cascading to dependents. When false or omitted, disposes this object and all its dependent effects and listeners. |
58
+
59
+ #### Returns
60
+
61
+ `void`
62
+
63
+ #### Throws
64
+
65
+ Error if the object has already been disposed (behavior may vary by implementation).
@@ -0,0 +1,19 @@
1
+ [@ersbeth/picoflow](/api/index.md) / SolidObservable
2
+
3
+ # Interface: SolidObservable\<T\>
4
+
5
+ Defined in: [solid/primitives.ts:22](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/solid/primitives.ts#L22)
6
+
7
+ Interface for a Solid-style observable value.
8
+
9
+ ## Type Parameters
10
+
11
+ | Type Parameter | Description |
12
+ | ------ | ------ |
13
+ | `T` | The value type. |
14
+
15
+ ## Properties
16
+
17
+ | Property | Type | Description | Defined in |
18
+ | ------ | ------ | ------ | ------ |
19
+ | <a id="get"></a> `get` | () => `T` | Returns the current value. | [solid/primitives.ts:26](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/solid/primitives.ts#L26) |
@@ -0,0 +1,49 @@
1
+ [@ersbeth/picoflow](/api/index.md) / FlowArrayAction
2
+
3
+ # Type Alias: FlowArrayAction\<T\>
4
+
5
+ ```ts
6
+ type FlowArrayAction<T> =
7
+ | {
8
+ items: T[];
9
+ type: "set";
10
+ }
11
+ | {
12
+ index: number;
13
+ item: T;
14
+ type: "setItem";
15
+ }
16
+ | {
17
+ item: T;
18
+ type: "push";
19
+ }
20
+ | {
21
+ type: "pop";
22
+ }
23
+ | {
24
+ item: T;
25
+ type: "unshift";
26
+ }
27
+ | {
28
+ type: "shift";
29
+ }
30
+ | {
31
+ deleteCount: number;
32
+ items: T[];
33
+ start: number;
34
+ type: "splice";
35
+ }
36
+ | {
37
+ type: "clear";
38
+ };
39
+ ```
40
+
41
+ Defined in: [advanced/array.ts:8](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/advanced/array.ts#L8)
42
+
43
+ Represents the actions that can be performed on a FlowArray.
44
+
45
+ ## Type Parameters
46
+
47
+ | Type Parameter |
48
+ | ------ |
49
+ | `T` |
@@ -0,0 +1,15 @@
1
+ [@ersbeth/picoflow](/api/index.md) / FlowStreamDisposer
2
+
3
+ # Type Alias: FlowStreamDisposer()
4
+
5
+ ```ts
6
+ type FlowStreamDisposer = () => void;
7
+ ```
8
+
9
+ Defined in: [advanced/stream.ts:14](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/advanced/stream.ts#L14)
10
+
11
+ A function type that disposes of a resource.
12
+
13
+ ## Returns
14
+
15
+ `void`
@@ -0,0 +1,27 @@
1
+ [@ersbeth/picoflow](/api/index.md) / FlowStreamSetter
2
+
3
+ # Type Alias: FlowStreamSetter()\<T\>
4
+
5
+ ```ts
6
+ type FlowStreamSetter<T> = (value) => void;
7
+ ```
8
+
9
+ Defined in: [advanced/stream.ts:8](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/advanced/stream.ts#L8)
10
+
11
+ A function type that sets a new value for the reactive stream.
12
+
13
+ ## Type Parameters
14
+
15
+ | Type Parameter | Description |
16
+ | ------ | ------ |
17
+ | `T` | The type of the value. |
18
+
19
+ ## Parameters
20
+
21
+ | Parameter | Type |
22
+ | ------ | ------ |
23
+ | `value` | `T` |
24
+
25
+ ## Returns
26
+
27
+ `void`
@@ -0,0 +1,32 @@
1
+ [@ersbeth/picoflow](/api/index.md) / FlowStreamUpdater
2
+
3
+ # Type Alias: FlowStreamUpdater()\<T\>
4
+
5
+ ```ts
6
+ type FlowStreamUpdater<T> = (set) => FlowStreamDisposer;
7
+ ```
8
+
9
+ Defined in: [advanced/stream.ts:24](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/advanced/stream.ts#L24)
10
+
11
+ A function type that updates a stream and returns a disposer for cleanup.
12
+
13
+ ## Type Parameters
14
+
15
+ | Type Parameter | Description |
16
+ | ------ | ------ |
17
+ | `T` | The type of the stream value. |
18
+
19
+ ## Parameters
20
+
21
+ | Parameter | Type |
22
+ | ------ | ------ |
23
+ | `set` | [`FlowStreamSetter`](/api/type-aliases/FlowStreamSetter.md)\<`T`\> |
24
+
25
+ ## Returns
26
+
27
+ [`FlowStreamDisposer`](/api/type-aliases/FlowStreamDisposer.md)
28
+
29
+ ## Remarks
30
+
31
+ The updater receives a setter function to update the stream's value.
32
+ It should return a disposer function to release any resources or subscriptions.
@@ -0,0 +1,18 @@
1
+ [@ersbeth/picoflow](/api/index.md) / NotPromise
2
+
3
+ # Type Alias: NotPromise\<T\>
4
+
5
+ ```ts
6
+ type NotPromise<T> = T extends Promise<unknown> ? never : T;
7
+ ```
8
+
9
+ Defined in: [solid/converters.ts:149](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/solid/converters.ts#L149)
10
+
11
+ Utility type that excludes Promise types from T.
12
+ Used to ensure type safety for synchronous derivations/resources.
13
+
14
+ ## Type Parameters
15
+
16
+ | Type Parameter |
17
+ | ------ |
18
+ | `T` |
@@ -0,0 +1,17 @@
1
+ [@ersbeth/picoflow](/api/index.md) / SolidGetter
2
+
3
+ # Type Alias: SolidGetter\<T\>
4
+
5
+ ```ts
6
+ type SolidGetter<T> = (previous) => T | T;
7
+ ```
8
+
9
+ Defined in: [solid/primitives.ts:14](https://gitlab.com/ersbeth-web/picoflow/-/blob/a6cd2e5702b60b87a8efe22e2fe7d2ce3b0ccca4/src/solid/primitives.ts#L14)
10
+
11
+ A getter function or value for Solid state/derivation.
12
+
13
+ ## Type Parameters
14
+
15
+ | Type Parameter | Description |
16
+ | ------ | ------ |
17
+ | `T` | The value type. |
@@ -0,0 +1 @@
1
+ [{"text":"Classes","collapsed":true,"items":[{"text":"FlowArray","link":"/api/classes/FlowArray.md"},{"text":"FlowConstant","link":"/api/classes/FlowConstant.md"},{"text":"FlowDerivation","link":"/api/classes/FlowDerivation.md"},{"text":"FlowEffect","link":"/api/classes/FlowEffect.md"},{"text":"FlowMap","link":"/api/classes/FlowMap.md"},{"text":"FlowObservable","link":"/api/classes/FlowObservable.md"},{"text":"FlowResource","link":"/api/classes/FlowResource.md"},{"text":"FlowResourceAsync","link":"/api/classes/FlowResourceAsync.md"},{"text":"FlowSignal","link":"/api/classes/FlowSignal.md"},{"text":"FlowState","link":"/api/classes/FlowState.md"},{"text":"FlowStream","link":"/api/classes/FlowStream.md"},{"text":"FlowStreamAsync","link":"/api/classes/FlowStreamAsync.md"},{"text":"SolidDerivation","link":"/api/classes/SolidDerivation.md"},{"text":"SolidResource","link":"/api/classes/SolidResource.md"},{"text":"SolidState","link":"/api/classes/SolidState.md"},{"text":"TrackingContext","link":"/api/classes/TrackingContext.md"}]},{"text":"Interfaces","collapsed":true,"items":[{"text":"FlowDisposable","link":"/api/interfaces/FlowDisposable.md"},{"text":"SolidObservable","link":"/api/interfaces/SolidObservable.md"}]},{"text":"Type Aliases","collapsed":true,"items":[{"text":"FlowArrayAction","link":"/api/type-aliases/FlowArrayAction.md"},{"text":"FlowStreamDisposer","link":"/api/type-aliases/FlowStreamDisposer.md"},{"text":"FlowStreamSetter","link":"/api/type-aliases/FlowStreamSetter.md"},{"text":"FlowStreamUpdater","link":"/api/type-aliases/FlowStreamUpdater.md"},{"text":"NotPromise","link":"/api/type-aliases/NotPromise.md"},{"text":"SolidGetter","link":"/api/type-aliases/SolidGetter.md"}]},{"text":"Functions","collapsed":true,"items":[{"text":"array","link":"/api/functions/array.md"},{"text":"constant","link":"/api/functions/constant.md"},{"text":"derivation","link":"/api/functions/derivation.md"},{"text":"effect","link":"/api/functions/effect.md"},{"text":"from","link":"/api/functions/from.md"},{"text":"isDisposable","link":"/api/functions/isDisposable.md"},{"text":"map","link":"/api/functions/map.md"},{"text":"resource","link":"/api/functions/resource.md"},{"text":"resourceAsync","link":"/api/functions/resourceAsync.md"},{"text":"signal","link":"/api/functions/signal.md"},{"text":"state","link":"/api/functions/state.md"},{"text":"stream","link":"/api/functions/stream.md"},{"text":"streamAsync","link":"/api/functions/streamAsync.md"}]}]