@ersbeth/picoflow 0.2.4 → 1.0.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.
- package/.cursor/plans/update-js-e795d61b.plan.md +567 -0
- package/.gitlab-ci.yml +24 -0
- package/.vscode/settings.json +3 -3
- package/CHANGELOG.md +51 -0
- package/IMPLEMENTATION_GUIDE.md +1578 -0
- package/README.md +62 -25
- package/biome.json +32 -32
- package/dist/picoflow.js +610 -436
- package/dist/types/advanced/array.d.ts +0 -6
- package/dist/types/advanced/array.d.ts.map +1 -1
- package/dist/types/advanced/index.d.ts +5 -5
- package/dist/types/advanced/index.d.ts.map +1 -1
- package/dist/types/advanced/map.d.ts +114 -23
- package/dist/types/advanced/map.d.ts.map +1 -1
- package/dist/types/advanced/resource.d.ts +51 -12
- package/dist/types/advanced/resource.d.ts.map +1 -1
- package/dist/types/advanced/resourceAsync.d.ts +28 -13
- package/dist/types/advanced/resourceAsync.d.ts.map +1 -1
- package/dist/types/advanced/stream.d.ts +74 -16
- package/dist/types/advanced/stream.d.ts.map +1 -1
- package/dist/types/advanced/streamAsync.d.ts +69 -15
- package/dist/types/advanced/streamAsync.d.ts.map +1 -1
- package/dist/types/basic/constant.d.ts +44 -16
- package/dist/types/basic/constant.d.ts.map +1 -1
- package/dist/types/basic/derivation.d.ts +73 -24
- package/dist/types/basic/derivation.d.ts.map +1 -1
- package/dist/types/basic/disposable.d.ts +65 -6
- package/dist/types/basic/disposable.d.ts.map +1 -1
- package/dist/types/basic/effect.d.ts +27 -16
- package/dist/types/basic/effect.d.ts.map +1 -1
- package/dist/types/basic/index.d.ts +7 -8
- package/dist/types/basic/index.d.ts.map +1 -1
- package/dist/types/basic/observable.d.ts +62 -13
- package/dist/types/basic/observable.d.ts.map +1 -1
- package/dist/types/basic/signal.d.ts +35 -6
- package/dist/types/basic/signal.d.ts.map +1 -1
- package/dist/types/basic/state.d.ts +25 -4
- package/dist/types/basic/state.d.ts.map +1 -1
- package/dist/types/basic/trackingContext.d.ts +33 -0
- package/dist/types/basic/trackingContext.d.ts.map +1 -0
- package/dist/types/creators.d.ts +271 -26
- package/dist/types/creators.d.ts.map +1 -1
- package/dist/types/index.d.ts +60 -7
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/solid/converters.d.ts +5 -5
- package/dist/types/solid/converters.d.ts.map +1 -1
- package/dist/types/solid/index.d.ts +2 -2
- package/dist/types/solid/index.d.ts.map +1 -1
- package/dist/types/solid/primitives.d.ts +96 -4
- package/dist/types/solid/primitives.d.ts.map +1 -1
- package/docs/.vitepress/config.mts +110 -0
- package/docs/api/classes/FlowArray.md +489 -0
- package/docs/api/classes/FlowConstant.md +350 -0
- package/docs/api/classes/FlowDerivation.md +334 -0
- package/docs/api/classes/FlowEffect.md +100 -0
- package/docs/api/classes/FlowMap.md +512 -0
- package/docs/api/classes/FlowObservable.md +306 -0
- package/docs/api/classes/FlowResource.md +380 -0
- package/docs/api/classes/FlowResourceAsync.md +362 -0
- package/docs/api/classes/FlowSignal.md +160 -0
- package/docs/api/classes/FlowState.md +368 -0
- package/docs/api/classes/FlowStream.md +367 -0
- package/docs/api/classes/FlowStreamAsync.md +364 -0
- package/docs/api/classes/SolidDerivation.md +75 -0
- package/docs/api/classes/SolidResource.md +91 -0
- package/docs/api/classes/SolidState.md +71 -0
- package/docs/api/classes/TrackingContext.md +33 -0
- package/docs/api/functions/array.md +58 -0
- package/docs/api/functions/constant.md +45 -0
- package/docs/api/functions/derivation.md +53 -0
- package/docs/api/functions/effect.md +49 -0
- package/docs/api/functions/from.md +220 -0
- package/docs/api/functions/isDisposable.md +49 -0
- package/docs/api/functions/map.md +57 -0
- package/docs/api/functions/resource.md +52 -0
- package/docs/api/functions/resourceAsync.md +50 -0
- package/docs/api/functions/signal.md +36 -0
- package/docs/api/functions/state.md +47 -0
- package/docs/api/functions/stream.md +53 -0
- package/docs/api/functions/streamAsync.md +50 -0
- package/docs/api/index.md +118 -0
- package/docs/api/interfaces/FlowDisposable.md +65 -0
- package/docs/api/interfaces/SolidObservable.md +19 -0
- package/docs/api/type-aliases/FlowArrayAction.md +49 -0
- package/docs/api/type-aliases/FlowStreamDisposer.md +15 -0
- package/docs/api/type-aliases/FlowStreamSetter.md +27 -0
- package/docs/api/type-aliases/FlowStreamUpdater.md +32 -0
- package/docs/api/type-aliases/NotPromise.md +18 -0
- package/docs/api/type-aliases/SolidGetter.md +17 -0
- package/docs/api/typedoc-sidebar.json +1 -0
- package/docs/examples/examples.md +2313 -0
- package/docs/examples/patterns.md +649 -0
- package/docs/guide/advanced/disposal.md +426 -0
- package/docs/guide/advanced/solidjs.md +221 -0
- package/docs/guide/advanced/upgrading.md +464 -0
- package/docs/guide/introduction/concepts.md +56 -0
- package/docs/guide/introduction/conventions.md +61 -0
- package/docs/guide/introduction/getting-started.md +134 -0
- package/docs/guide/introduction/lifecycle.md +371 -0
- package/docs/guide/primitives/array.md +400 -0
- package/docs/guide/primitives/constant.md +380 -0
- package/docs/guide/primitives/derivations.md +348 -0
- package/docs/guide/primitives/effects.md +458 -0
- package/docs/guide/primitives/map.md +387 -0
- package/docs/guide/primitives/overview.md +175 -0
- package/docs/guide/primitives/resources.md +858 -0
- package/docs/guide/primitives/signal.md +259 -0
- package/docs/guide/primitives/state.md +368 -0
- package/docs/guide/primitives/streams.md +931 -0
- package/docs/index.md +47 -0
- package/docs/public/logo.svg +1 -0
- package/package.json +57 -41
- package/src/advanced/array.ts +208 -210
- package/src/advanced/index.ts +7 -7
- package/src/advanced/map.ts +178 -68
- package/src/advanced/resource.ts +87 -43
- package/src/advanced/resourceAsync.ts +62 -42
- package/src/advanced/stream.ts +113 -50
- package/src/advanced/streamAsync.ts +120 -61
- package/src/basic/constant.ts +82 -49
- package/src/basic/derivation.ts +128 -84
- package/src/basic/disposable.ts +74 -15
- package/src/basic/effect.ts +85 -77
- package/src/basic/index.ts +7 -8
- package/src/basic/observable.ts +94 -36
- package/src/basic/signal.ts +133 -105
- package/src/basic/state.ts +46 -25
- package/src/basic/trackingContext.ts +45 -0
- package/src/creators.ts +297 -54
- package/src/index.ts +96 -43
- package/src/solid/converters.ts +186 -67
- package/src/solid/index.ts +8 -2
- package/src/solid/primitives.ts +167 -65
- package/test/array.test.ts +592 -612
- package/test/constant.test.ts +31 -33
- package/test/derivation.test.ts +531 -536
- package/test/effect.test.ts +21 -21
- package/test/map.test.ts +233 -137
- package/test/resource.test.ts +119 -121
- package/test/resourceAsync.test.ts +98 -100
- package/test/signal.test.ts +51 -55
- package/test/state.test.ts +186 -168
- package/test/stream.test.ts +189 -189
- package/test/streamAsync.test.ts +186 -186
- package/tsconfig.json +19 -18
- package/typedoc.json +37 -0
- package/vite.config.ts +23 -23
- package/vitest.config.ts +7 -7
- package/api/doc/index.md +0 -31
- package/api/doc/picoflow.array.md +0 -55
- package/api/doc/picoflow.constant.md +0 -55
- package/api/doc/picoflow.derivation.md +0 -55
- package/api/doc/picoflow.effect.md +0 -55
- package/api/doc/picoflow.flowarray._constructor_.md +0 -49
- package/api/doc/picoflow.flowarray._lastaction.md +0 -13
- package/api/doc/picoflow.flowarray.clear.md +0 -17
- package/api/doc/picoflow.flowarray.dispose.md +0 -55
- package/api/doc/picoflow.flowarray.get.md +0 -19
- package/api/doc/picoflow.flowarray.length.md +0 -13
- package/api/doc/picoflow.flowarray.md +0 -273
- package/api/doc/picoflow.flowarray.pop.md +0 -17
- package/api/doc/picoflow.flowarray.push.md +0 -53
- package/api/doc/picoflow.flowarray.set.md +0 -53
- package/api/doc/picoflow.flowarray.setitem.md +0 -69
- package/api/doc/picoflow.flowarray.shift.md +0 -17
- package/api/doc/picoflow.flowarray.splice.md +0 -85
- package/api/doc/picoflow.flowarray.unshift.md +0 -53
- package/api/doc/picoflow.flowarrayaction.md +0 -37
- package/api/doc/picoflow.flowconstant._constructor_.md +0 -49
- package/api/doc/picoflow.flowconstant.get.md +0 -25
- package/api/doc/picoflow.flowconstant.md +0 -88
- package/api/doc/picoflow.flowderivation._constructor_.md +0 -49
- package/api/doc/picoflow.flowderivation.get.md +0 -23
- package/api/doc/picoflow.flowderivation.md +0 -86
- package/api/doc/picoflow.flowdisposable.dispose.md +0 -55
- package/api/doc/picoflow.flowdisposable.md +0 -43
- package/api/doc/picoflow.floweffect._constructor_.md +0 -54
- package/api/doc/picoflow.floweffect.dispose.md +0 -21
- package/api/doc/picoflow.floweffect.disposed.md +0 -13
- package/api/doc/picoflow.floweffect.md +0 -131
- package/api/doc/picoflow.flowgetter.md +0 -15
- package/api/doc/picoflow.flowmap._lastdeleted.md +0 -21
- package/api/doc/picoflow.flowmap._lastset.md +0 -21
- package/api/doc/picoflow.flowmap.delete.md +0 -61
- package/api/doc/picoflow.flowmap.md +0 -133
- package/api/doc/picoflow.flowmap.setat.md +0 -77
- package/api/doc/picoflow.flowobservable.get.md +0 -19
- package/api/doc/picoflow.flowobservable.md +0 -68
- package/api/doc/picoflow.flowobservable.subscribe.md +0 -55
- package/api/doc/picoflow.flowresource._constructor_.md +0 -49
- package/api/doc/picoflow.flowresource.fetch.md +0 -27
- package/api/doc/picoflow.flowresource.get.md +0 -23
- package/api/doc/picoflow.flowresource.md +0 -100
- package/api/doc/picoflow.flowresourceasync._constructor_.md +0 -49
- package/api/doc/picoflow.flowresourceasync.fetch.md +0 -27
- package/api/doc/picoflow.flowresourceasync.get.md +0 -23
- package/api/doc/picoflow.flowresourceasync.md +0 -100
- package/api/doc/picoflow.flowsignal.dispose.md +0 -59
- package/api/doc/picoflow.flowsignal.disposed.md +0 -18
- package/api/doc/picoflow.flowsignal.md +0 -112
- package/api/doc/picoflow.flowsignal.trigger.md +0 -21
- package/api/doc/picoflow.flowstate.md +0 -52
- package/api/doc/picoflow.flowstate.set.md +0 -61
- package/api/doc/picoflow.flowstream._constructor_.md +0 -49
- package/api/doc/picoflow.flowstream.dispose.md +0 -21
- package/api/doc/picoflow.flowstream.get.md +0 -23
- package/api/doc/picoflow.flowstream.md +0 -100
- package/api/doc/picoflow.flowstreamasync._constructor_.md +0 -54
- package/api/doc/picoflow.flowstreamasync.dispose.md +0 -21
- package/api/doc/picoflow.flowstreamasync.get.md +0 -23
- package/api/doc/picoflow.flowstreamasync.md +0 -100
- package/api/doc/picoflow.flowstreamdisposer.md +0 -13
- package/api/doc/picoflow.flowstreamsetter.md +0 -13
- package/api/doc/picoflow.flowstreamupdater.md +0 -19
- package/api/doc/picoflow.flowwatcher.md +0 -15
- package/api/doc/picoflow.from.md +0 -55
- package/api/doc/picoflow.from_1.md +0 -55
- package/api/doc/picoflow.from_2.md +0 -55
- package/api/doc/picoflow.from_3.md +0 -55
- package/api/doc/picoflow.from_4.md +0 -55
- package/api/doc/picoflow.from_5.md +0 -55
- package/api/doc/picoflow.isdisposable.md +0 -55
- package/api/doc/picoflow.map.md +0 -59
- package/api/doc/picoflow.md +0 -544
- package/api/doc/picoflow.resource.md +0 -55
- package/api/doc/picoflow.resourceasync.md +0 -55
- package/api/doc/picoflow.signal.md +0 -19
- package/api/doc/picoflow.solidderivation._constructor_.md +0 -49
- package/api/doc/picoflow.solidderivation.get.md +0 -13
- package/api/doc/picoflow.solidderivation.md +0 -94
- package/api/doc/picoflow.solidgetter.md +0 -13
- package/api/doc/picoflow.solidobservable.get.md +0 -13
- package/api/doc/picoflow.solidobservable.md +0 -57
- package/api/doc/picoflow.solidresource._constructor_.md +0 -49
- package/api/doc/picoflow.solidresource.get.md +0 -13
- package/api/doc/picoflow.solidresource.latest.md +0 -13
- package/api/doc/picoflow.solidresource.md +0 -157
- package/api/doc/picoflow.solidresource.refetch.md +0 -13
- package/api/doc/picoflow.solidresource.state.md +0 -13
- package/api/doc/picoflow.solidstate._constructor_.md +0 -49
- package/api/doc/picoflow.solidstate.get.md +0 -13
- package/api/doc/picoflow.solidstate.md +0 -115
- package/api/doc/picoflow.solidstate.set.md +0 -13
- package/api/doc/picoflow.state.md +0 -55
- package/api/doc/picoflow.stream.md +0 -55
- package/api/doc/picoflow.streamasync.md +0 -55
- package/api/picoflow.public.api.md +0 -244
- package/api-extractor.json +0 -61
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowEffect](./picoflow.floweffect.md) > [(constructor)](./picoflow.floweffect._constructor_.md)
|
|
4
|
-
|
|
5
|
-
## FlowEffect.(constructor)
|
|
6
|
-
|
|
7
|
-
Creates a new FlowEffect.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
constructor(apply: (get: FlowGetter, watch: FlowWatcher) => void);
|
|
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
|
-
apply
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
(get: [FlowGetter](./picoflow.flowgetter.md)<!-- -->, watch: [FlowWatcher](./picoflow.flowwatcher.md)<!-- -->) => void
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
A side-effect function that receives a getter and a watcher to access and register dependencies on reactive observables and signals.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
|
|
51
|
-
## Remarks
|
|
52
|
-
|
|
53
|
-
The provided function is executed immediately in a tracked mode to collect dependencies. On subsequent executions, it runs in an untracked mode.
|
|
54
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowEffect](./picoflow.floweffect.md) > [dispose](./picoflow.floweffect.dispose.md)
|
|
4
|
-
|
|
5
|
-
## FlowEffect.dispose() method
|
|
6
|
-
|
|
7
|
-
Disposes the effect, unregistering all its tracked dependencies.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
dispose(): void;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
void
|
|
17
|
-
|
|
18
|
-
## Remarks
|
|
19
|
-
|
|
20
|
-
Once disposed, the effect must no longer be used. Trying to dispose an effect that is already disposed will throw an error.
|
|
21
|
-
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowEffect](./picoflow.floweffect.md) > [disposed](./picoflow.floweffect.disposed.md)
|
|
4
|
-
|
|
5
|
-
## FlowEffect.disposed property
|
|
6
|
-
|
|
7
|
-
Indicates whether this effect has been disposed.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
get disposed(): boolean;
|
|
13
|
-
```
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowEffect](./picoflow.floweffect.md)
|
|
4
|
-
|
|
5
|
-
## FlowEffect class
|
|
6
|
-
|
|
7
|
-
Represents a reactive effect that executes side-effect functions based on its tracked dependencies.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare class FlowEffect
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Remarks
|
|
16
|
-
|
|
17
|
-
The FlowEffect executes an apply function that performs side effects, running initially in a tracked mode to register dependencies and then in an untracked mode to re-execute the effect on updates.
|
|
18
|
-
|
|
19
|
-
## Constructors
|
|
20
|
-
|
|
21
|
-
<table><thead><tr><th>
|
|
22
|
-
|
|
23
|
-
Constructor
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
</th><th>
|
|
27
|
-
|
|
28
|
-
Modifiers
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</th><th>
|
|
32
|
-
|
|
33
|
-
Description
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</th></tr></thead>
|
|
37
|
-
<tbody><tr><td>
|
|
38
|
-
|
|
39
|
-
[(constructor)(apply)](./picoflow.floweffect._constructor_.md)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
</td><td>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
</td><td>
|
|
46
|
-
|
|
47
|
-
Creates a new FlowEffect.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
</td></tr>
|
|
51
|
-
</tbody></table>
|
|
52
|
-
|
|
53
|
-
## Properties
|
|
54
|
-
|
|
55
|
-
<table><thead><tr><th>
|
|
56
|
-
|
|
57
|
-
Property
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</th><th>
|
|
61
|
-
|
|
62
|
-
Modifiers
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</th><th>
|
|
66
|
-
|
|
67
|
-
Type
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
</th><th>
|
|
71
|
-
|
|
72
|
-
Description
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
</th></tr></thead>
|
|
76
|
-
<tbody><tr><td>
|
|
77
|
-
|
|
78
|
-
[disposed](./picoflow.floweffect.disposed.md)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</td><td>
|
|
82
|
-
|
|
83
|
-
`readonly`
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
</td><td>
|
|
87
|
-
|
|
88
|
-
boolean
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
</td><td>
|
|
92
|
-
|
|
93
|
-
Indicates whether this effect has been disposed.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
</td></tr>
|
|
97
|
-
</tbody></table>
|
|
98
|
-
|
|
99
|
-
## Methods
|
|
100
|
-
|
|
101
|
-
<table><thead><tr><th>
|
|
102
|
-
|
|
103
|
-
Method
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
</th><th>
|
|
107
|
-
|
|
108
|
-
Modifiers
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
</th><th>
|
|
112
|
-
|
|
113
|
-
Description
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</th></tr></thead>
|
|
117
|
-
<tbody><tr><td>
|
|
118
|
-
|
|
119
|
-
[dispose()](./picoflow.floweffect.dispose.md)
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</td><td>
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
</td><td>
|
|
126
|
-
|
|
127
|
-
Disposes the effect, unregistering all its tracked dependencies.
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
</td></tr>
|
|
131
|
-
</tbody></table>
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowGetter](./picoflow.flowgetter.md)
|
|
4
|
-
|
|
5
|
-
## FlowGetter type
|
|
6
|
-
|
|
7
|
-
A function that retrieves the current value from a FlowObservable.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export type FlowGetter = <T>(observable: FlowObservable<T>) => T;
|
|
13
|
-
```
|
|
14
|
-
**References:** [FlowObservable](./picoflow.flowobservable.md)
|
|
15
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowMap](./picoflow.flowmap.md) > [$lastDeleted](./picoflow.flowmap._lastdeleted.md)
|
|
4
|
-
|
|
5
|
-
## FlowMap.$lastDeleted property
|
|
6
|
-
|
|
7
|
-
A reactive state that holds the most recent key and value that were deleted.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
$lastDeleted: FlowState<{
|
|
13
|
-
key?: K;
|
|
14
|
-
value?: V;
|
|
15
|
-
}>;
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Remarks
|
|
19
|
-
|
|
20
|
-
When a key is deleted via [FlowMap.delete()](./picoflow.flowmap.delete.md)<!-- -->, this state is updated with the corresponding key and its last known value.
|
|
21
|
-
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowMap](./picoflow.flowmap.md) > [$lastSet](./picoflow.flowmap._lastset.md)
|
|
4
|
-
|
|
5
|
-
## FlowMap.$lastSet property
|
|
6
|
-
|
|
7
|
-
A reactive state that holds the most recent key and value that were set.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
$lastSet: FlowState<{
|
|
13
|
-
key?: K;
|
|
14
|
-
value?: V;
|
|
15
|
-
}>;
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Remarks
|
|
19
|
-
|
|
20
|
-
When a key is set via [FlowMap.setAt()](./picoflow.flowmap.setat.md)<!-- -->, this state is updated with the corresponding key and value.
|
|
21
|
-
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowMap](./picoflow.flowmap.md) > [delete](./picoflow.flowmap.delete.md)
|
|
4
|
-
|
|
5
|
-
## FlowMap.delete() method
|
|
6
|
-
|
|
7
|
-
Deletes the value at the specified key from the underlying map.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
delete(key: K): void;
|
|
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
|
-
key
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
K
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
The key to delete.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
**Returns:**
|
|
51
|
-
|
|
52
|
-
void
|
|
53
|
-
|
|
54
|
-
## Exceptions
|
|
55
|
-
|
|
56
|
-
If the FlowMap instance is disposed.
|
|
57
|
-
|
|
58
|
-
## Remarks
|
|
59
|
-
|
|
60
|
-
Removes the key from the internal map, emits the deleted key and its value via [FlowMap.$lastDeleted](./picoflow.flowmap._lastdeleted.md)<!-- -->, and notifies all subscribers of the change.
|
|
61
|
-
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowMap](./picoflow.flowmap.md)
|
|
4
|
-
|
|
5
|
-
## FlowMap class
|
|
6
|
-
|
|
7
|
-
Represents a reactive map of states extending [FlowState](./picoflow.flowstate.md) for a Map of key/value pairs.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare class FlowMap<K, V> extends FlowState<Map<K, V>>
|
|
13
|
-
```
|
|
14
|
-
**Extends:** [FlowState](./picoflow.flowstate.md)<!-- --><Map<K, V>>
|
|
15
|
-
|
|
16
|
-
## Remarks
|
|
17
|
-
|
|
18
|
-
FlowMap wraps a native Map and provides reactive signals for fine-grained tracking of updates to the map. In addition to the reactive capabilities inherited from FlowState, it exposes two reactive signals:
|
|
19
|
-
|
|
20
|
-
• $lastSet: Holds the most recent key-value pair that was set. • $lastDeleted: Holds the most recent key-value pair that was deleted.
|
|
21
|
-
|
|
22
|
-
Use [FlowMap.setAt()](./picoflow.flowmap.setat.md) to add or update a key-value pair and [FlowMap.delete()](./picoflow.flowmap.delete.md) to remove a key.
|
|
23
|
-
|
|
24
|
-
## Properties
|
|
25
|
-
|
|
26
|
-
<table><thead><tr><th>
|
|
27
|
-
|
|
28
|
-
Property
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
</th><th>
|
|
32
|
-
|
|
33
|
-
Modifiers
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</th><th>
|
|
37
|
-
|
|
38
|
-
Type
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
</th><th>
|
|
42
|
-
|
|
43
|
-
Description
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
</th></tr></thead>
|
|
47
|
-
<tbody><tr><td>
|
|
48
|
-
|
|
49
|
-
[$lastDeleted](./picoflow.flowmap._lastdeleted.md)
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
</td><td>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</td><td>
|
|
56
|
-
|
|
57
|
-
[FlowState](./picoflow.flowstate.md)<!-- --><{ key?: K; value?: V; }>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
</td><td>
|
|
61
|
-
|
|
62
|
-
A reactive state that holds the most recent key and value that were deleted.
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
</td></tr>
|
|
66
|
-
<tr><td>
|
|
67
|
-
|
|
68
|
-
[$lastSet](./picoflow.flowmap._lastset.md)
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
</td><td>
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
</td><td>
|
|
75
|
-
|
|
76
|
-
[FlowState](./picoflow.flowstate.md)<!-- --><{ key?: K; value?: V; }>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</td><td>
|
|
80
|
-
|
|
81
|
-
A reactive state that holds the most recent key and value that were set.
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</td></tr>
|
|
85
|
-
</tbody></table>
|
|
86
|
-
|
|
87
|
-
## Methods
|
|
88
|
-
|
|
89
|
-
<table><thead><tr><th>
|
|
90
|
-
|
|
91
|
-
Method
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
</th><th>
|
|
95
|
-
|
|
96
|
-
Modifiers
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</th><th>
|
|
100
|
-
|
|
101
|
-
Description
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</th></tr></thead>
|
|
105
|
-
<tbody><tr><td>
|
|
106
|
-
|
|
107
|
-
[delete(key)](./picoflow.flowmap.delete.md)
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
</td><td>
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
</td><td>
|
|
114
|
-
|
|
115
|
-
Deletes the value at the specified key from the underlying map.
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
</td></tr>
|
|
119
|
-
<tr><td>
|
|
120
|
-
|
|
121
|
-
[setAt(key, value)](./picoflow.flowmap.setat.md)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
</td><td>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
</td><td>
|
|
128
|
-
|
|
129
|
-
Sets a value at the specified key in the underlying map.
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
</td></tr>
|
|
133
|
-
</tbody></table>
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowMap](./picoflow.flowmap.md) > [setAt](./picoflow.flowmap.setat.md)
|
|
4
|
-
|
|
5
|
-
## FlowMap.setAt() method
|
|
6
|
-
|
|
7
|
-
Sets a value at the specified key in the underlying map.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
setAt(key: K, value: V): void;
|
|
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
|
-
key
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
K
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
The key at which to set the value.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
<tr><td>
|
|
50
|
-
|
|
51
|
-
value
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</td><td>
|
|
55
|
-
|
|
56
|
-
V
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
The value to set.
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
</td></tr>
|
|
65
|
-
</tbody></table>
|
|
66
|
-
**Returns:**
|
|
67
|
-
|
|
68
|
-
void
|
|
69
|
-
|
|
70
|
-
## Exceptions
|
|
71
|
-
|
|
72
|
-
If the FlowMap instance is disposed.
|
|
73
|
-
|
|
74
|
-
## Remarks
|
|
75
|
-
|
|
76
|
-
Updates the internal map, emits the key-value pair via [FlowMap.$lastSet](./picoflow.flowmap._lastset.md)<!-- -->, and notifies all subscribers of the change.
|
|
77
|
-
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowObservable](./picoflow.flowobservable.md) > [get](./picoflow.flowobservable.get.md)
|
|
4
|
-
|
|
5
|
-
## FlowObservable.get() method
|
|
6
|
-
|
|
7
|
-
Retrieves the current value stored in the observable. Subclasses must override this method to provide the current value.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
abstract get(): T;
|
|
13
|
-
```
|
|
14
|
-
**Returns:**
|
|
15
|
-
|
|
16
|
-
T
|
|
17
|
-
|
|
18
|
-
The current value of type T.
|
|
19
|
-
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowObservable](./picoflow.flowobservable.md)
|
|
4
|
-
|
|
5
|
-
## FlowObservable class
|
|
6
|
-
|
|
7
|
-
Represents a reactive observable that holds and tracks a value.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
export declare abstract class FlowObservable<T> extends FlowSignal
|
|
13
|
-
```
|
|
14
|
-
**Extends:** [FlowSignal](./picoflow.flowsignal.md)
|
|
15
|
-
|
|
16
|
-
## Remarks
|
|
17
|
-
|
|
18
|
-
Subclasses must implement the [FlowObservable.get()](./picoflow.flowobservable.get.md) method to return the current value.
|
|
19
|
-
|
|
20
|
-
## Methods
|
|
21
|
-
|
|
22
|
-
<table><thead><tr><th>
|
|
23
|
-
|
|
24
|
-
Method
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
</th><th>
|
|
28
|
-
|
|
29
|
-
Modifiers
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</th><th>
|
|
33
|
-
|
|
34
|
-
Description
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</th></tr></thead>
|
|
38
|
-
<tbody><tr><td>
|
|
39
|
-
|
|
40
|
-
[get()](./picoflow.flowobservable.get.md)
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
`abstract`
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td><td>
|
|
49
|
-
|
|
50
|
-
Retrieves the current value stored in the observable. Subclasses must override this method to provide the current value.
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
</td></tr>
|
|
54
|
-
<tr><td>
|
|
55
|
-
|
|
56
|
-
[subscribe(listener)](./picoflow.flowobservable.subscribe.md)
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
</td><td>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
</td><td>
|
|
63
|
-
|
|
64
|
-
Subscribes a listener function to changes of the observable. The listener is executed immediately with the current value and on subsequent updates.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</td></tr>
|
|
68
|
-
</tbody></table>
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
-
|
|
3
|
-
[Home](./index.md) > [@ersbeth/picoflow](./picoflow.md) > [FlowObservable](./picoflow.flowobservable.md) > [subscribe](./picoflow.flowobservable.subscribe.md)
|
|
4
|
-
|
|
5
|
-
## FlowObservable.subscribe() method
|
|
6
|
-
|
|
7
|
-
Subscribes a listener function to changes of the observable. The listener is executed immediately with the current value and on subsequent updates.
|
|
8
|
-
|
|
9
|
-
**Signature:**
|
|
10
|
-
|
|
11
|
-
```typescript
|
|
12
|
-
subscribe(listener: (value: T) => void): () => void;
|
|
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
|
-
listener
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
</td><td>
|
|
39
|
-
|
|
40
|
-
(value: T) => void
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
</td><td>
|
|
44
|
-
|
|
45
|
-
A callback function that receives the new value.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</td></tr>
|
|
49
|
-
</tbody></table>
|
|
50
|
-
**Returns:**
|
|
51
|
-
|
|
52
|
-
() => void
|
|
53
|
-
|
|
54
|
-
A disposer function to cancel the subscription.
|
|
55
|
-
|