@ersbeth/picoflow 0.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.
- package/.vscode/settings.json +5 -0
- package/README.md +151 -0
- package/api/doc/index.md +31 -0
- package/api/doc/picoflow.derivation.md +55 -0
- package/api/doc/picoflow.effect.md +55 -0
- package/api/doc/picoflow.flowderivation._constructor_.md +49 -0
- package/api/doc/picoflow.flowderivation.get.md +23 -0
- package/api/doc/picoflow.flowderivation.md +86 -0
- package/api/doc/picoflow.flowdisposer.md +13 -0
- package/api/doc/picoflow.floweffect._constructor_.md +49 -0
- package/api/doc/picoflow.floweffect.dispose.md +21 -0
- package/api/doc/picoflow.floweffect.disposed.md +13 -0
- package/api/doc/picoflow.floweffect.md +131 -0
- package/api/doc/picoflow.flowgetter.md +15 -0
- package/api/doc/picoflow.flowmap._lastdeleted.md +21 -0
- package/api/doc/picoflow.flowmap._lastset.md +21 -0
- package/api/doc/picoflow.flowmap.delete.md +57 -0
- package/api/doc/picoflow.flowmap.md +135 -0
- package/api/doc/picoflow.flowmap.setat.md +73 -0
- package/api/doc/picoflow.flowobservable.get.md +19 -0
- package/api/doc/picoflow.flowobservable.md +54 -0
- package/api/doc/picoflow.flowresource._constructor_.md +65 -0
- package/api/doc/picoflow.flowresource.fetch.md +27 -0
- package/api/doc/picoflow.flowresource.get.md +23 -0
- package/api/doc/picoflow.flowresource.md +100 -0
- package/api/doc/picoflow.flowsetter.md +13 -0
- package/api/doc/picoflow.flowsignal.dispose.md +25 -0
- package/api/doc/picoflow.flowsignal.disposed.md +18 -0
- package/api/doc/picoflow.flowsignal.md +111 -0
- package/api/doc/picoflow.flowsignal.trigger.md +25 -0
- package/api/doc/picoflow.flowstate._constructor_.md +49 -0
- package/api/doc/picoflow.flowstate.get.md +23 -0
- package/api/doc/picoflow.flowstate.md +100 -0
- package/api/doc/picoflow.flowstate.set.md +61 -0
- package/api/doc/picoflow.flowstream._constructor_.md +65 -0
- package/api/doc/picoflow.flowstream.dispose.md +21 -0
- package/api/doc/picoflow.flowstream.get.md +23 -0
- package/api/doc/picoflow.flowstream.md +100 -0
- package/api/doc/picoflow.flowupdater.md +19 -0
- package/api/doc/picoflow.flowwatcher.md +15 -0
- package/api/doc/picoflow.map.md +59 -0
- package/api/doc/picoflow.md +287 -0
- package/api/doc/picoflow.resource.md +71 -0
- package/api/doc/picoflow.signal.md +19 -0
- package/api/doc/picoflow.state.md +55 -0
- package/api/doc/picoflow.stream.md +71 -0
- package/api/picoflow.api.md +145 -0
- package/api-extractor.json +60 -0
- package/biome.json +34 -0
- package/dist/picoflow.js +572 -0
- package/dist/types/creators.d.ts +70 -0
- package/dist/types/creators.d.ts.map +1 -0
- package/dist/types/derivation.d.ts +58 -0
- package/dist/types/derivation.d.ts.map +1 -0
- package/dist/types/effect.d.ts +108 -0
- package/dist/types/effect.d.ts.map +1 -0
- package/dist/types/index.d.ts +18 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/map.d.ts +75 -0
- package/dist/types/map.d.ts.map +1 -0
- package/dist/types/observable.d.ts +40 -0
- package/dist/types/observable.d.ts.map +1 -0
- package/dist/types/resource.d.ts +46 -0
- package/dist/types/resource.d.ts.map +1 -0
- package/dist/types/signal.d.ts +111 -0
- package/dist/types/signal.d.ts.map +1 -0
- package/dist/types/state.d.ts +39 -0
- package/dist/types/state.d.ts.map +1 -0
- package/dist/types/stream.d.ts +71 -0
- package/dist/types/stream.d.ts.map +1 -0
- package/package.json +40 -0
- package/src/creators.ts +101 -0
- package/src/derivation.ts +96 -0
- package/src/effect.ts +152 -0
- package/src/index.ts +30 -0
- package/src/map.ts +83 -0
- package/src/observable.ts +50 -0
- package/src/resource.ts +64 -0
- package/src/signal.ts +166 -0
- package/src/state.ts +52 -0
- package/src/stream.ts +99 -0
- package/test/derivation.test.ts +422 -0
- package/test/map.test.ts +106 -0
- package/test/resource.test.ts +127 -0
- package/test/signal.test.ts +59 -0
- package/test/state.test.ts +89 -0
- package/test/stream.test.ts +171 -0
- package/tsconfig.json +22 -0
- package/vite.config.ts +26 -0
- package/vitest.config.ts +11 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowSignal](./picoflow.flowsignal.md)
|
|
4
|
+
|
|
5
|
+
## FlowSignal class
|
|
6
|
+
|
|
7
|
+
Represents a reactive signal.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class FlowSignal
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
A FlowSignal allows you to trigger notifications via [FlowSignal.trigger()](./picoflow.flowsignal.trigger.md) and to dispose the signal and all its registered dependencies, listeners, and effects via [FlowSignal.dispose()](./picoflow.flowsignal.dispose.md)<!-- -->.
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
<table><thead><tr><th>
|
|
22
|
+
|
|
23
|
+
Property
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
</th><th>
|
|
27
|
+
|
|
28
|
+
Modifiers
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
</th><th>
|
|
32
|
+
|
|
33
|
+
Type
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
</th><th>
|
|
37
|
+
|
|
38
|
+
Description
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
</th></tr></thead>
|
|
42
|
+
<tbody><tr><td>
|
|
43
|
+
|
|
44
|
+
[disposed](./picoflow.flowsignal.disposed.md)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
</td><td>
|
|
48
|
+
|
|
49
|
+
`readonly`
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
</td><td>
|
|
53
|
+
|
|
54
|
+
boolean
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
</td><td>
|
|
58
|
+
|
|
59
|
+
Indicates whether the signal has been disposed.
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
</td></tr>
|
|
63
|
+
</tbody></table>
|
|
64
|
+
|
|
65
|
+
## Methods
|
|
66
|
+
|
|
67
|
+
<table><thead><tr><th>
|
|
68
|
+
|
|
69
|
+
Method
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
</th><th>
|
|
73
|
+
|
|
74
|
+
Modifiers
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
</th><th>
|
|
78
|
+
|
|
79
|
+
Description
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
</th></tr></thead>
|
|
83
|
+
<tbody><tr><td>
|
|
84
|
+
|
|
85
|
+
[dispose()](./picoflow.flowsignal.dispose.md)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
</td><td>
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
Disposes the signal.
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
</td></tr>
|
|
97
|
+
<tr><td>
|
|
98
|
+
|
|
99
|
+
[trigger()](./picoflow.flowsignal.trigger.md)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
</td><td>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
</td><td>
|
|
106
|
+
|
|
107
|
+
Triggers the signal.
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
</td></tr>
|
|
111
|
+
</tbody></table>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowSignal](./picoflow.flowsignal.md) > [trigger](./picoflow.flowsignal.trigger.md)
|
|
4
|
+
|
|
5
|
+
## FlowSignal.trigger() method
|
|
6
|
+
|
|
7
|
+
Triggers the signal.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
trigger(): void;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
void
|
|
17
|
+
|
|
18
|
+
## Exceptions
|
|
19
|
+
|
|
20
|
+
Error if the signal is disposed.
|
|
21
|
+
|
|
22
|
+
## Remarks
|
|
23
|
+
|
|
24
|
+
This method notifies all registered listeners and causes associated effects to execute.
|
|
25
|
+
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowState](./picoflow.flowstate.md) > [(constructor)](./picoflow.flowstate._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## FlowState.(constructor)
|
|
6
|
+
|
|
7
|
+
Creates a new FlowState with the given initial value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(value: 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
|
+
value
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
T
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
The initial value for the state.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowState](./picoflow.flowstate.md) > [get](./picoflow.flowstate.get.md)
|
|
4
|
+
|
|
5
|
+
## FlowState.get() method
|
|
6
|
+
|
|
7
|
+
Retrieves the current state value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get(): T;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
T
|
|
17
|
+
|
|
18
|
+
The current value of the state.
|
|
19
|
+
|
|
20
|
+
## Exceptions
|
|
21
|
+
|
|
22
|
+
Error if the state has been disposed.
|
|
23
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowState](./picoflow.flowstate.md)
|
|
4
|
+
|
|
5
|
+
## FlowState class
|
|
6
|
+
|
|
7
|
+
Represents a reactive state that holds a mutable value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class FlowState<T> extends FlowObservable<T>
|
|
13
|
+
```
|
|
14
|
+
**Extends:** [FlowObservable](./picoflow.flowobservable.md)<!-- --><T>
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
FlowState extends FlowObservable to provide a simple reactive state primitive. Use the [FlowState.get()](./picoflow.flowstate.get.md) method to read the current state and [FlowState.set()](./picoflow.flowstate.set.md) to update it. When the state is updated, subscribers are notified automatically.
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
<table><thead><tr><th>
|
|
23
|
+
|
|
24
|
+
Constructor
|
|
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
|
+
[(constructor)(value)](./picoflow.flowstate._constructor_.md)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
Creates a new FlowState with the given initial value.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</td></tr>
|
|
52
|
+
</tbody></table>
|
|
53
|
+
|
|
54
|
+
## Methods
|
|
55
|
+
|
|
56
|
+
<table><thead><tr><th>
|
|
57
|
+
|
|
58
|
+
Method
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</th><th>
|
|
62
|
+
|
|
63
|
+
Modifiers
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</th><th>
|
|
67
|
+
|
|
68
|
+
Description
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</th></tr></thead>
|
|
72
|
+
<tbody><tr><td>
|
|
73
|
+
|
|
74
|
+
[get()](./picoflow.flowstate.get.md)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
</td><td>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
</td><td>
|
|
81
|
+
|
|
82
|
+
Retrieves the current state value.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</td></tr>
|
|
86
|
+
<tr><td>
|
|
87
|
+
|
|
88
|
+
[set(value)](./picoflow.flowstate.set.md)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
</td><td>
|
|
95
|
+
|
|
96
|
+
Updates the state with a new value.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
</td></tr>
|
|
100
|
+
</tbody></table>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowState](./picoflow.flowstate.md) > [set](./picoflow.flowstate.set.md)
|
|
4
|
+
|
|
5
|
+
## FlowState.set() method
|
|
6
|
+
|
|
7
|
+
Updates the state with a new value.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
set(value: T): 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
|
+
value
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
T
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
The new value to set.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
50
|
+
**Returns:**
|
|
51
|
+
|
|
52
|
+
void
|
|
53
|
+
|
|
54
|
+
## Exceptions
|
|
55
|
+
|
|
56
|
+
Error if the state has been disposed.
|
|
57
|
+
|
|
58
|
+
## Remarks
|
|
59
|
+
|
|
60
|
+
If the new value is identical to the current value, no update or notification occurs. Otherwise, the state is updated and all subscribers are notified.
|
|
61
|
+
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowStream](./picoflow.flowstream.md) > [(constructor)](./picoflow.flowstream._constructor_.md)
|
|
4
|
+
|
|
5
|
+
## FlowStream.(constructor)
|
|
6
|
+
|
|
7
|
+
Creates a new FlowStream.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
constructor(updater: FlowUpdater<T>, initial: 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
|
+
[FlowUpdater](./picoflow.flowupdater.md)<!-- --><T>
|
|
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 that will be called upon disposal.
|
|
46
|
+
|
|
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
|
+
</td></tr>
|
|
65
|
+
</tbody></table>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowStream](./picoflow.flowstream.md) > [dispose](./picoflow.flowstream.dispose.md)
|
|
4
|
+
|
|
5
|
+
## FlowStream.dispose() method
|
|
6
|
+
|
|
7
|
+
Disposes the stream, releasing all resources.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
dispose(): void;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
void
|
|
17
|
+
|
|
18
|
+
## Remarks
|
|
19
|
+
|
|
20
|
+
In addition to disposing the underlying observable, this method calls the disposer returned by the updater.
|
|
21
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowStream](./picoflow.flowstream.md) > [get](./picoflow.flowstream.get.md)
|
|
4
|
+
|
|
5
|
+
## FlowStream.get() method
|
|
6
|
+
|
|
7
|
+
Retrieves the current value of the stream.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
get(): T;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
T
|
|
17
|
+
|
|
18
|
+
The current value.
|
|
19
|
+
|
|
20
|
+
## Exceptions
|
|
21
|
+
|
|
22
|
+
Error if the stream is disposed.
|
|
23
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowStream](./picoflow.flowstream.md)
|
|
4
|
+
|
|
5
|
+
## FlowStream class
|
|
6
|
+
|
|
7
|
+
Represents a reactive stream that updates its value based on an updater function.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare class FlowStream<T> extends FlowObservable<T>
|
|
13
|
+
```
|
|
14
|
+
**Extends:** [FlowObservable](./picoflow.flowobservable.md)<!-- --><T>
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
A FlowStream extends FlowObservable and encapsulates a mechanism for updating its value via an external updater function. The updater is invoked during construction with a setter, and it returns a disposer to be called when the stream is disposed.
|
|
19
|
+
|
|
20
|
+
## Constructors
|
|
21
|
+
|
|
22
|
+
<table><thead><tr><th>
|
|
23
|
+
|
|
24
|
+
Constructor
|
|
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
|
+
[(constructor)(updater, initial)](./picoflow.flowstream._constructor_.md)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
</td><td>
|
|
47
|
+
|
|
48
|
+
Creates a new FlowStream.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
</td></tr>
|
|
52
|
+
</tbody></table>
|
|
53
|
+
|
|
54
|
+
## Methods
|
|
55
|
+
|
|
56
|
+
<table><thead><tr><th>
|
|
57
|
+
|
|
58
|
+
Method
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
</th><th>
|
|
62
|
+
|
|
63
|
+
Modifiers
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
</th><th>
|
|
67
|
+
|
|
68
|
+
Description
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
</th></tr></thead>
|
|
72
|
+
<tbody><tr><td>
|
|
73
|
+
|
|
74
|
+
[dispose()](./picoflow.flowstream.dispose.md)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
</td><td>
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
</td><td>
|
|
81
|
+
|
|
82
|
+
Disposes the stream, releasing all resources.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
</td></tr>
|
|
86
|
+
<tr><td>
|
|
87
|
+
|
|
88
|
+
[get()](./picoflow.flowstream.get.md)
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
</td><td>
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
</td><td>
|
|
95
|
+
|
|
96
|
+
Retrieves the current value of the stream.
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
</td></tr>
|
|
100
|
+
</tbody></table>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowUpdater](./picoflow.flowupdater.md)
|
|
4
|
+
|
|
5
|
+
## FlowUpdater type
|
|
6
|
+
|
|
7
|
+
A function that performs updates on a stream.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type FlowUpdater<T> = (set: FlowSetter<T>) => FlowDisposer;
|
|
13
|
+
```
|
|
14
|
+
**References:** [FlowSetter](./picoflow.flowsetter.md)<!-- -->, [FlowDisposer](./picoflow.flowdisposer.md)
|
|
15
|
+
|
|
16
|
+
## Remarks
|
|
17
|
+
|
|
18
|
+
The updater receives a setter function that can be used to update the stream's value. It should return a disposer function to clean up any resources or subscriptions.
|
|
19
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [FlowWatcher](./picoflow.flowwatcher.md)
|
|
4
|
+
|
|
5
|
+
## FlowWatcher type
|
|
6
|
+
|
|
7
|
+
A function for watching a FlowSignal.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type FlowWatcher = (signal: FlowSignal) => void;
|
|
13
|
+
```
|
|
14
|
+
**References:** [FlowSignal](./picoflow.flowsignal.md)
|
|
15
|
+
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [picoflow](./picoflow.md) > [map](./picoflow.map.md)
|
|
4
|
+
|
|
5
|
+
## map() function
|
|
6
|
+
|
|
7
|
+
Creates a new reactive map state.
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function map<K extends string | number | symbol, V>(initial?: Record<K, V>): FlowMap<K, V>;
|
|
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
|
+
initial
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
</td><td>
|
|
39
|
+
|
|
40
|
+
Record<K, V>
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
</td><td>
|
|
44
|
+
|
|
45
|
+
_(Optional)_ An optional record of key-value pairs to initialize the map.
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
</td></tr>
|
|
49
|
+
</tbody></table>
|
|
50
|
+
**Returns:**
|
|
51
|
+
|
|
52
|
+
[FlowMap](./picoflow.flowmap.md)<!-- --><K, V>
|
|
53
|
+
|
|
54
|
+
A new instance of [FlowMap](./picoflow.flowmap.md)<!-- -->.
|
|
55
|
+
|
|
56
|
+
## Remarks
|
|
57
|
+
|
|
58
|
+
The initial record is converted to a native Map before being used.
|
|
59
|
+
|