@thi.ng/rstream 8.2.6 → 8.2.8
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/CHANGELOG.md +7 -1
- package/README.md +2 -1
- package/asidechain.js +1 -0
- package/merge.js +1 -0
- package/metastream.js +5 -0
- package/package.json +15 -16
- package/pubsub.js +2 -0
- package/resolve.js +2 -1
- package/sidechain-partition.js +1 -0
- package/sidechain-toggle.js +1 -0
- package/sidechain-trigger.js +1 -1
- package/stream.js +3 -0
- package/subscription.js +11 -3
- package/sync-raf.js +2 -0
- package/sync.js +18 -0
- package/timeout.js +4 -0
- package/tunnel.js +6 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
- **Last updated**: 2023-11-
|
|
3
|
+
- **Last updated**: 2023-11-09T10:02:12Z
|
|
4
4
|
- **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
|
|
5
5
|
|
|
6
6
|
All notable changes to this project will be documented in this file.
|
|
@@ -9,6 +9,12 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
|
|
|
9
9
|
**Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
|
|
10
10
|
and/or version bumps of transitive dependencies.
|
|
11
11
|
|
|
12
|
+
### [8.2.8](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@8.2.8) (2023-11-09)
|
|
13
|
+
|
|
14
|
+
#### ♻️ Refactoring
|
|
15
|
+
|
|
16
|
+
- update all tests (packages A-S) ([e3085e4](https://github.com/thi-ng/umbrella/commit/e3085e4))
|
|
17
|
+
|
|
12
18
|
## [8.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@8.2.0) (2023-10-18)
|
|
13
19
|
|
|
14
20
|
#### 🚀 Features
|
package/README.md
CHANGED
|
@@ -198,7 +198,7 @@ For Node.js REPL:
|
|
|
198
198
|
const rstream = await import("@thi.ng/rstream");
|
|
199
199
|
```
|
|
200
200
|
|
|
201
|
-
Package sizes (brotli'd, pre-treeshake): ESM:
|
|
201
|
+
Package sizes (brotli'd, pre-treeshake): ESM: 6.13 KB
|
|
202
202
|
|
|
203
203
|
## Dependencies
|
|
204
204
|
|
|
@@ -240,6 +240,7 @@ directory are using this package:
|
|
|
240
240
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/parse-playground.png" width="240"/> | Parser grammar livecoding editor/playground & codegen | [Demo](https://demo.thi.ng/umbrella/parse-playground/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/parse-playground) |
|
|
241
241
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pixel-sorting.png" width="240"/> | Interactive pixel sorting tool using thi.ng/color & thi.ng/pixel | [Demo](https://demo.thi.ng/umbrella/pixel-sorting/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pixel-sorting) |
|
|
242
242
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/pointfree-geom.jpg" width="240"/> | Live coding playground for 2D geometry generation using @thi.ng/pointfree-lang | [Demo](https://demo.thi.ng/umbrella/pointfree-geom/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/pointfree-geom) |
|
|
243
|
+
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/procedural-text.jpg" width="240"/> | Procedural stochastic text generation via custom DSL, parse grammar & AST transformation | [Demo](https://demo.thi.ng/umbrella/procedural-text/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/procedural-text) |
|
|
243
244
|
| | Demonstates various rdom usage patterns | [Demo](https://demo.thi.ng/umbrella/rdom-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-basics) |
|
|
244
245
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-canvas-basics.jpg" width="240"/> | Minimal rdom-canvas animation | [Demo](https://demo.thi.ng/umbrella/rdom-canvas-basics/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-canvas-basics) |
|
|
245
246
|
| <img src="https://raw.githubusercontent.com/thi-ng/umbrella/develop/assets/examples/rdom-delayed-update.jpg" width="240"/> | Dynamically loaded images w/ preloader state | [Demo](https://demo.thi.ng/umbrella/rdom-delayed-update/) | [Source](https://github.com/thi-ng/umbrella/tree/develop/examples/rdom-delayed-update) |
|
package/asidechain.js
CHANGED
package/merge.js
CHANGED
|
@@ -63,6 +63,7 @@ export const merge = (opts) => new StreamMerge(opts);
|
|
|
63
63
|
* @see {@link merge} for reference & examples.
|
|
64
64
|
*/
|
|
65
65
|
export class StreamMerge extends Subscription {
|
|
66
|
+
sources;
|
|
66
67
|
constructor(opts) {
|
|
67
68
|
opts = opts || {};
|
|
68
69
|
super(undefined, __optsWithID("streammerge", opts));
|
package/metastream.js
CHANGED
|
@@ -86,6 +86,11 @@ export const metaStream = (factory, opts) => new MetaStream(factory, opts);
|
|
|
86
86
|
* @see {@link metaStream} for reference & examples.
|
|
87
87
|
*/
|
|
88
88
|
export class MetaStream extends Subscription {
|
|
89
|
+
factory;
|
|
90
|
+
stream;
|
|
91
|
+
sub;
|
|
92
|
+
emitLast;
|
|
93
|
+
doneRequested;
|
|
89
94
|
constructor(factory, opts = {}) {
|
|
90
95
|
super(undefined, __optsWithID("metastram", opts));
|
|
91
96
|
this.factory = factory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rstream",
|
|
3
|
-
"version": "8.2.
|
|
3
|
+
"version": "8.2.8",
|
|
4
4
|
"description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,27 +32,26 @@
|
|
|
32
32
|
"clean": "rimraf --glob '*.js' '*.d.ts' '*.map' doc internal",
|
|
33
33
|
"doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
|
|
34
34
|
"doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
|
|
35
|
-
"doc:readme": "
|
|
36
|
-
"doc:stats": "tools:module-stats",
|
|
35
|
+
"doc:readme": "bun ../../tools/src/module-stats.ts && bun ../../tools/src/readme.ts",
|
|
37
36
|
"pub": "yarn npm publish --access public",
|
|
38
|
-
"test": "
|
|
37
|
+
"test": "bun test"
|
|
39
38
|
},
|
|
40
39
|
"dependencies": {
|
|
41
|
-
"@thi.ng/api": "^8.9.
|
|
42
|
-
"@thi.ng/arrays": "^2.7.
|
|
43
|
-
"@thi.ng/associative": "^6.3.
|
|
44
|
-
"@thi.ng/atom": "^5.2.
|
|
45
|
-
"@thi.ng/checks": "^3.4.
|
|
46
|
-
"@thi.ng/errors": "^2.4.
|
|
47
|
-
"@thi.ng/logger": "^1.4.
|
|
48
|
-
"@thi.ng/transducers": "^8.8.
|
|
40
|
+
"@thi.ng/api": "^8.9.7",
|
|
41
|
+
"@thi.ng/arrays": "^2.7.3",
|
|
42
|
+
"@thi.ng/associative": "^6.3.18",
|
|
43
|
+
"@thi.ng/atom": "^5.2.13",
|
|
44
|
+
"@thi.ng/checks": "^3.4.7",
|
|
45
|
+
"@thi.ng/errors": "^2.4.1",
|
|
46
|
+
"@thi.ng/logger": "^1.4.23",
|
|
47
|
+
"@thi.ng/transducers": "^8.8.9"
|
|
49
48
|
},
|
|
50
49
|
"devDependencies": {
|
|
51
|
-
"@microsoft/api-extractor": "^7.38.
|
|
52
|
-
"@thi.ng/testament": "^0.
|
|
50
|
+
"@microsoft/api-extractor": "^7.38.2",
|
|
51
|
+
"@thi.ng/testament": "^0.4.0",
|
|
53
52
|
"rimraf": "^5.0.5",
|
|
54
53
|
"tools": "^0.0.1",
|
|
55
|
-
"typedoc": "^0.25.
|
|
54
|
+
"typedoc": "^0.25.3",
|
|
56
55
|
"typescript": "^5.2.2"
|
|
57
56
|
},
|
|
58
57
|
"keywords": [
|
|
@@ -214,5 +213,5 @@
|
|
|
214
213
|
],
|
|
215
214
|
"year": 2017
|
|
216
215
|
},
|
|
217
|
-
"gitHead": "
|
|
216
|
+
"gitHead": "9f4d8ad79bca1d68214fbc9bbc5fb55f5a445f7e\n"
|
|
218
217
|
}
|
package/pubsub.js
CHANGED
|
@@ -36,6 +36,8 @@ export const pubsub = (opts) => new PubSub(opts);
|
|
|
36
36
|
* @see {@link pubsub} for reference & examples.
|
|
37
37
|
*/
|
|
38
38
|
export class PubSub extends Subscription {
|
|
39
|
+
topicfn;
|
|
40
|
+
topics;
|
|
39
41
|
constructor(opts) {
|
|
40
42
|
super(undefined, __optsWithID("pubsub", {
|
|
41
43
|
xform: opts.xform,
|
package/resolve.js
CHANGED
|
@@ -28,9 +28,10 @@ import { Subscription } from "./subscription.js";
|
|
|
28
28
|
*/
|
|
29
29
|
export const resolve = (opts) => new Resolver(opts);
|
|
30
30
|
export class Resolver extends Subscription {
|
|
31
|
+
outstanding = 0;
|
|
32
|
+
fail;
|
|
31
33
|
constructor(opts = {}) {
|
|
32
34
|
super(undefined, __optsWithID("resolve"));
|
|
33
|
-
this.outstanding = 0;
|
|
34
35
|
this.fail = opts.fail;
|
|
35
36
|
}
|
|
36
37
|
next(x) {
|
package/sidechain-partition.js
CHANGED
|
@@ -67,6 +67,7 @@ export const sidechainPartition = (src, side, opts) => src.subscribe(new Sidecha
|
|
|
67
67
|
*/
|
|
68
68
|
export const sidechainPartitionRAF = (src) => sidechainPartition(src, fromRAF()).transform(map(peek));
|
|
69
69
|
export class SidechainPartition extends ASidechain {
|
|
70
|
+
buf;
|
|
70
71
|
constructor(side, opts) {
|
|
71
72
|
opts = __optsWithID("sidepart", opts);
|
|
72
73
|
super(opts);
|
package/sidechain-toggle.js
CHANGED
|
@@ -30,6 +30,7 @@ import { __optsWithID } from "./idgen.js";
|
|
|
30
30
|
*/
|
|
31
31
|
export const sidechainToggle = (src, side, opts) => src.subscribe(new SidechainToggle(side, opts));
|
|
32
32
|
export class SidechainToggle extends ASidechain {
|
|
33
|
+
isActive;
|
|
33
34
|
constructor(side, opts) {
|
|
34
35
|
opts = __optsWithID("sidetoggle", opts);
|
|
35
36
|
super(opts);
|
package/sidechain-trigger.js
CHANGED
|
@@ -44,10 +44,10 @@ import { __optsWithID } from "./idgen.js";
|
|
|
44
44
|
*/
|
|
45
45
|
export const sidechainTrigger = (src, side, opts) => src.subscribe(new SidechainTrigger(side, opts));
|
|
46
46
|
export class SidechainTrigger extends ASidechain {
|
|
47
|
+
buf = SEMAPHORE;
|
|
47
48
|
constructor(side, opts) {
|
|
48
49
|
opts = __optsWithID("sidetrigger", opts);
|
|
49
50
|
super(opts);
|
|
50
|
-
this.buf = SEMAPHORE;
|
|
51
51
|
const pred = opts.pred || (() => true);
|
|
52
52
|
this.sideSub = side.subscribe({
|
|
53
53
|
next: (x) => {
|
package/stream.js
CHANGED
|
@@ -23,6 +23,9 @@ export const reactive = (val, opts) => {
|
|
|
23
23
|
* @see {@link stream} & {@link reactive} for reference & examples.
|
|
24
24
|
*/
|
|
25
25
|
export class Stream extends Subscription {
|
|
26
|
+
src;
|
|
27
|
+
_cancel;
|
|
28
|
+
_inited;
|
|
26
29
|
constructor(src, opts) {
|
|
27
30
|
const [_src, _opts] = isFunction(src)
|
|
28
31
|
? [src, opts || {}]
|
package/subscription.js
CHANGED
|
@@ -61,11 +61,19 @@ import { LOGGER } from "./logger.js";
|
|
|
61
61
|
*/
|
|
62
62
|
export const subscription = (sub, opts) => new Subscription(sub, opts);
|
|
63
63
|
export class Subscription {
|
|
64
|
+
wrapped;
|
|
65
|
+
id;
|
|
66
|
+
closeIn;
|
|
67
|
+
closeOut;
|
|
68
|
+
parent;
|
|
69
|
+
__owner;
|
|
70
|
+
xform;
|
|
71
|
+
cacheLast;
|
|
72
|
+
last = SEMAPHORE;
|
|
73
|
+
state = State.IDLE;
|
|
74
|
+
subs = [];
|
|
64
75
|
constructor(wrapped, opts) {
|
|
65
76
|
this.wrapped = wrapped;
|
|
66
|
-
this.last = SEMAPHORE;
|
|
67
|
-
this.state = State.IDLE;
|
|
68
|
-
this.subs = [];
|
|
69
77
|
opts = __optsWithID(`sub`, {
|
|
70
78
|
closeIn: CloseMode.LAST,
|
|
71
79
|
closeOut: CloseMode.LAST,
|
package/sync-raf.js
CHANGED
package/sync.js
CHANGED
|
@@ -62,6 +62,24 @@ export const sync = (opts) => new StreamSync(opts);
|
|
|
62
62
|
* @see {@link sync} for reference & examples.
|
|
63
63
|
*/
|
|
64
64
|
export class StreamSync extends Subscription {
|
|
65
|
+
/**
|
|
66
|
+
* maps actual inputs to their virtual input subs
|
|
67
|
+
*/
|
|
68
|
+
sources;
|
|
69
|
+
/**
|
|
70
|
+
* maps real source IDs to their actual input
|
|
71
|
+
*/
|
|
72
|
+
idSources;
|
|
73
|
+
/**
|
|
74
|
+
* maps (potentially aliased) input IDs to their actual src.id
|
|
75
|
+
*/
|
|
76
|
+
realSourceIDs;
|
|
77
|
+
/**
|
|
78
|
+
* maps real src.id to (potentially aliased) input IDs
|
|
79
|
+
*/
|
|
80
|
+
invRealSourceIDs;
|
|
81
|
+
psync;
|
|
82
|
+
clean;
|
|
65
83
|
constructor(opts) {
|
|
66
84
|
const psync = partitionSync(new Set(), {
|
|
67
85
|
key: (x) => x[0],
|
package/timeout.js
CHANGED
|
@@ -21,6 +21,10 @@ export const timeout = (timeoutMs, opts) => new Timeout(timeoutMs, opts);
|
|
|
21
21
|
* @see {@link timeout} for reference & examples.
|
|
22
22
|
*/
|
|
23
23
|
class Timeout extends Subscription {
|
|
24
|
+
timeoutMs;
|
|
25
|
+
timeoutId;
|
|
26
|
+
errorObj;
|
|
27
|
+
resetTimeout;
|
|
24
28
|
constructor(timeoutMs, opts) {
|
|
25
29
|
opts = __optsWithID("timeout", opts);
|
|
26
30
|
super(undefined, opts);
|
package/tunnel.js
CHANGED
|
@@ -22,6 +22,12 @@ export const tunnel = (opts) => new Tunnel(opts);
|
|
|
22
22
|
* @see {@link tunnel} for reference & examples.
|
|
23
23
|
*/
|
|
24
24
|
export class Tunnel extends Subscription {
|
|
25
|
+
workers;
|
|
26
|
+
src;
|
|
27
|
+
transferables;
|
|
28
|
+
terminate;
|
|
29
|
+
interrupt;
|
|
30
|
+
index;
|
|
25
31
|
constructor(opts) {
|
|
26
32
|
super(undefined, { id: opts.id || `tunnel-${__nextID()}` });
|
|
27
33
|
this.src = opts.src;
|