@thi.ng/rstream 7.2.30 → 7.2.32

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-11-30T22:27:38Z
3
+ - **Last updated**: 2022-12-20T16:33:11Z
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
+ ### [7.2.31](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@7.2.31) (2022-12-16)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - (TS4.9 regression) update defWorker(), add explicit typehint ([bce5df7](https://github.com/thi-ng/umbrella/commit/bce5df7))
17
+
12
18
  ### [7.2.7](https://github.com/thi-ng/umbrella/tree/@thi.ng/rstream@7.2.7) (2022-06-09)
13
19
 
14
20
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -1,10 +1,10 @@
1
1
  <!-- This file is generated - DO NOT EDIT! -->
2
2
 
3
- # ![rstream](https://media.thi.ng/umbrella/banners-20220914/thing-rstream.svg?86471843)
3
+ # ![@thi.ng/rstream](https://media.thi.ng/umbrella/banners-20220914/thing-rstream.svg?86471843)
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@thi.ng/rstream.svg)](https://www.npmjs.com/package/@thi.ng/rstream)
6
6
  ![npm downloads](https://img.shields.io/npm/dm/@thi.ng/rstream.svg)
7
- [![Twitter Follow](https://img.shields.io/twitter/follow/thing_umbrella.svg?style=flat-square&label=twitter)](https://twitter.com/thing_umbrella)
7
+ [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  This project is part of the
10
10
  [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
@@ -41,13 +41,11 @@ This project is part of the
41
41
  - [Other subscription ops](#other-subscription-ops)
42
42
  - [Error handling](#error-handling)
43
43
  - [Authors](#authors)
44
- - [Maintainer](#maintainer)
45
- - [Contributors](#contributors)
46
44
  - [License](#license)
47
45
 
48
46
  ## About
49
47
 
50
- Reactive streams & subscription primitives for constructing dataflow graphs / pipelines.
48
+ Reactive streams & subscription primitives for constructing dataflow graphs / pipelines
51
49
 
52
50
  This library provides & uses three key building blocks for reactive
53
51
  programming:
@@ -194,11 +192,8 @@ ES module import:
194
192
 
195
193
  For Node.js REPL:
196
194
 
197
- ```text
198
- # with flag only for < v16
199
- node --experimental-repl-await
200
-
201
- > const rstream = await import("@thi.ng/rstream");
195
+ ```js
196
+ const rstream = await import("@thi.ng/rstream");
202
197
  ```
203
198
 
204
199
  Package sizes (brotli'd, pre-treeshake): ESM: 5.60 KB
@@ -878,14 +873,9 @@ src.next(2)
878
873
 
879
874
  ## Authors
880
875
 
881
- ### Maintainer
882
-
883
- - Karsten Schmidt ([@postspectacular](https://github.com/postspectacular))
884
-
885
- ### Contributors
886
-
887
- - André Wachter ([@andrew8er](https://github.com/andrew8er))
888
- - Gavin Cannizzaro ([@gavinpc-mindgrub](https://github.com/gavinpc-mindgrub))
876
+ - [Karsten Schmidt](https://thi.ng) (Main author)
877
+ - [André Wachter](https://github.com/andrew8er)
878
+ - [Gavin Cannizzaro](https://github.com/gavinpc-mindgrub)
889
879
 
890
880
  If this project contributes to an academic publication, please cite it as:
891
881
 
@@ -900,4 +890,4 @@ If this project contributes to an academic publication, please cite it as:
900
890
 
901
891
  ## License
902
892
 
903
- &copy; 2017 - 2022 Karsten Schmidt // Apache Software License 2.0
893
+ &copy; 2017 - 2022 Karsten Schmidt // Apache License 2.0
package/api.d.ts CHANGED
@@ -72,7 +72,7 @@ export interface WithTransform<A, B> {
72
72
  }
73
73
  export interface TransformableOpts<A, B> extends CommonOpts, WithTransform<A, B> {
74
74
  }
75
- export declare type ErrorHandler = Fn<any, boolean>;
75
+ export type ErrorHandler = Fn<any, boolean>;
76
76
  export interface WithErrorHandler {
77
77
  /**
78
78
  * Optional error handler to use for this
@@ -181,7 +181,7 @@ export interface ISubscription<A, B> extends IDeref<B | undefined>, ISubscriber<
181
181
  export interface IStream<T> extends ISubscriber<T> {
182
182
  cancel: StreamCancel;
183
183
  }
184
- export declare type StreamCancel = () => void;
185
- export declare type StreamSource<T> = (sub: Stream<T>) => StreamCancel | void;
186
- export declare type WorkerSource = Worker | Blob | Fn0<Worker> | string;
184
+ export type StreamCancel = () => void;
185
+ export type StreamSource<T> = (sub: Stream<T>) => StreamCancel | void;
186
+ export type WorkerSource = Worker | Blob | Fn0<Worker> | string;
187
187
  //# sourceMappingURL=api.d.ts.map
package/atom.d.ts CHANGED
@@ -18,15 +18,16 @@ export interface FromAtomOpts<T> extends CommonOpts {
18
18
  changed: Predicate2<T>;
19
19
  }
20
20
  /**
21
- * Yields {@link Stream} of value changes in given
22
- * {@link @thi.ng/atom# | Atom-like state container}.
21
+ * Yields {@link Stream} of value changes in given [Atom-like state
22
+ * container](https://thi.ng/atom).
23
23
  *
24
24
  * @remarks
25
- * Attaches a {@link @thi.ng/api#IWatch.addWatch | watch} to the atom
26
- * and checks for value changes with given `changed` predicate (`!==` by
27
- * default). If the predicate returns truthy result, the new value is
28
- * emitted on the stream. If `emitFirst` is true (default), also emits
29
- * atom's current value when first subscriber attaches to stream.
25
+ * [Attaches a
26
+ * watch](https://docs.thi.ng/umbrella/api/interfaces/IWatch.html#addWatch) to
27
+ * the atom and checks for value changes with given `changed` predicate (`!==`
28
+ * by default). If the predicate returns truthy result, the new value is emitted
29
+ * on the stream. If `emitFirst` is true (default), also emits atom's current
30
+ * value when first subscriber attaches to stream.
30
31
  *
31
32
  * Also see {@link fromView}, {@link fromViewUnsafe}
32
33
  *
package/atom.js CHANGED
@@ -1,15 +1,16 @@
1
1
  import { __optsWithID } from "./idgen.js";
2
2
  import { stream } from "./stream.js";
3
3
  /**
4
- * Yields {@link Stream} of value changes in given
5
- * {@link @thi.ng/atom# | Atom-like state container}.
4
+ * Yields {@link Stream} of value changes in given [Atom-like state
5
+ * container](https://thi.ng/atom).
6
6
  *
7
7
  * @remarks
8
- * Attaches a {@link @thi.ng/api#IWatch.addWatch | watch} to the atom
9
- * and checks for value changes with given `changed` predicate (`!==` by
10
- * default). If the predicate returns truthy result, the new value is
11
- * emitted on the stream. If `emitFirst` is true (default), also emits
12
- * atom's current value when first subscriber attaches to stream.
8
+ * [Attaches a
9
+ * watch](https://docs.thi.ng/umbrella/api/interfaces/IWatch.html#addWatch) to
10
+ * the atom and checks for value changes with given `changed` predicate (`!==`
11
+ * by default). If the predicate returns truthy result, the new value is emitted
12
+ * on the stream. If `emitFirst` is true (default), also emits atom's current
13
+ * value when first subscriber attaches to stream.
13
14
  *
14
15
  * Also see {@link fromView}, {@link fromViewUnsafe}
15
16
  *
package/forkjoin.d.ts CHANGED
@@ -103,7 +103,7 @@ export interface ForkJoinOpts<IN, MSG, RES, OUT> extends Partial<CommonOpts> {
103
103
  * @param opts -
104
104
  */
105
105
  export declare const forkJoin: <IN, MSG, RES, OUT>(opts: ForkJoinOpts<IN, MSG, RES, OUT>) => Subscription<any, OUT>;
106
- declare type Sliceable<T> = ArrayLike<T> & {
106
+ type Sliceable<T> = ArrayLike<T> & {
107
107
  slice(a: number, b?: number): Sliceable<T>;
108
108
  };
109
109
  /**
package/merge.d.ts CHANGED
@@ -11,9 +11,9 @@ export interface StreamMergeOpts<A, B> extends TransformableOpts<A, B> {
11
11
  * multiple inputs and passing received values on to any subscribers.
12
12
  *
13
13
  * @remarks
14
- * Input streams can be added and removed dynamically. By default,
15
- * `StreamMerge` calls {@link ISubscriber.done} when the last active
16
- * input is done, but this behavior can be overridden via the provided
14
+ * Input streams can be added and removed dynamically. By default, `StreamMerge`
15
+ * calls {@link ISubscriber.done} when the last active input is done, but this
16
+ * behavior can be overridden via the provided
17
17
  * {@link StreamMergeOpts | options}.
18
18
  *
19
19
  * @example
@@ -38,8 +38,10 @@ export interface StreamMergeOpts<A, B> extends TransformableOpts<A, B> {
38
38
  * ```
39
39
  *
40
40
  * @example
41
- * Use the {@link @thi.ng/transducers#(labeled:1)} transducer for each
42
- * input to create a stream of labeled values and track their provenance:
41
+ * Use the
42
+ * [`labeled()`](https://docs.thi.ng/umbrella/transducers/functions/labeled.html)
43
+ * transducer for each input to create a stream of labeled values and
44
+ * track their provenance:
43
45
  *
44
46
  * @example
45
47
  * ```ts
package/merge.js CHANGED
@@ -8,9 +8,9 @@ import { Subscription } from "./subscription.js";
8
8
  * multiple inputs and passing received values on to any subscribers.
9
9
  *
10
10
  * @remarks
11
- * Input streams can be added and removed dynamically. By default,
12
- * `StreamMerge` calls {@link ISubscriber.done} when the last active
13
- * input is done, but this behavior can be overridden via the provided
11
+ * Input streams can be added and removed dynamically. By default, `StreamMerge`
12
+ * calls {@link ISubscriber.done} when the last active input is done, but this
13
+ * behavior can be overridden via the provided
14
14
  * {@link StreamMergeOpts | options}.
15
15
  *
16
16
  * @example
@@ -35,8 +35,10 @@ import { Subscription } from "./subscription.js";
35
35
  * ```
36
36
  *
37
37
  * @example
38
- * Use the {@link @thi.ng/transducers#(labeled:1)} transducer for each
39
- * input to create a stream of labeled values and track their provenance:
38
+ * Use the
39
+ * [`labeled()`](https://docs.thi.ng/umbrella/transducers/functions/labeled.html)
40
+ * transducer for each input to create a stream of labeled values and
41
+ * track their provenance:
40
42
  *
41
43
  * @example
42
44
  * ```ts
package/object.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { Keys, Predicate2 } from "@thi.ng/api";
2
2
  import type { CommonOpts } from "./api.js";
3
3
  import { Subscription } from "./subscription.js";
4
- export declare type KeyStreams<T, K extends Keys<T>> = {
4
+ export type KeyStreams<T, K extends Keys<T>> = {
5
5
  [id in K]-?: Subscription<T[id], T[id]>;
6
6
  };
7
7
  /**
@@ -43,8 +43,9 @@ export interface StreamObjOpts<T, K extends Keys<T>> extends CommonOpts {
43
43
  */
44
44
  defaults: Partial<T>;
45
45
  /**
46
- * If true, attaches {@link @thi.ng/transducers#dedupe} transducer
47
- * to each key's value stream to avoid obsolete downstream
46
+ * If true, attaches
47
+ * [`dedupe()`](https://docs.thi.ng/umbrella/transducers/functions/dedupe.html)
48
+ * transducer to each key's value stream to avoid obsolete downstream
48
49
  * propagation when a key's value hasn't actually changed.
49
50
  *
50
51
  * @defaultValue true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/rstream",
3
- "version": "7.2.30",
3
+ "version": "7.2.32",
4
4
  "description": "Reactive streams & subscription primitives for constructing dataflow graphs / pipelines",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -21,11 +21,15 @@
21
21
  "url": "https://patreon.com/thing_umbrella"
22
22
  }
23
23
  ],
24
- "author": "Karsten Schmidt <k+npm@thi.ng>",
24
+ "author": "Karsten Schmidt (https://thi.ng)",
25
+ "contributors": [
26
+ "André Wachter (https://github.com/andrew8er)",
27
+ "Gavin Cannizzaro (https://github.com/gavinpc-mindgrub)"
28
+ ],
25
29
  "license": "Apache-2.0",
26
30
  "scripts": {
27
31
  "build": "yarn clean && tsc --declaration",
28
- "clean": "rimraf '*.js' '*.d.ts' '*.map' doc",
32
+ "clean": "rimraf '*.js' '*.d.ts' '*.map' doc internal",
29
33
  "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
30
34
  "doc:ae": "mkdir -p .ae/doc .ae/temp && api-extractor run --local --verbose",
31
35
  "doc:readme": "yarn doc:stats && tools:readme",
@@ -34,22 +38,22 @@
34
38
  "test": "testament test"
35
39
  },
36
40
  "dependencies": {
37
- "@thi.ng/api": "^8.5.1",
38
- "@thi.ng/arrays": "^2.4.4",
39
- "@thi.ng/associative": "^6.2.18",
40
- "@thi.ng/atom": "^5.1.24",
41
- "@thi.ng/checks": "^3.3.4",
42
- "@thi.ng/errors": "^2.2.5",
43
- "@thi.ng/logger": "^1.4.4",
44
- "@thi.ng/transducers": "^8.3.25"
41
+ "@thi.ng/api": "^8.6.1",
42
+ "@thi.ng/arrays": "^2.4.6",
43
+ "@thi.ng/associative": "^6.2.20",
44
+ "@thi.ng/atom": "^5.1.26",
45
+ "@thi.ng/checks": "^3.3.5",
46
+ "@thi.ng/errors": "^2.2.6",
47
+ "@thi.ng/logger": "^1.4.5",
48
+ "@thi.ng/transducers": "^8.3.27"
45
49
  },
46
50
  "devDependencies": {
47
- "@microsoft/api-extractor": "^7.33.5",
48
- "@thi.ng/testament": "^0.3.6",
51
+ "@microsoft/api-extractor": "^7.33.7",
52
+ "@thi.ng/testament": "^0.3.7",
49
53
  "rimraf": "^3.0.2",
50
54
  "tools": "^0.0.1",
51
- "typedoc": "^0.23.20",
52
- "typescript": "^4.8.4"
55
+ "typedoc": "^0.23.22",
56
+ "typescript": "^4.9.4"
53
57
  },
54
58
  "keywords": [
55
59
  "async",
@@ -201,5 +205,5 @@
201
205
  ],
202
206
  "year": 2017
203
207
  },
204
- "gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n"
208
+ "gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
205
209
  }
package/pubsub.d.ts CHANGED
@@ -33,9 +33,10 @@ export interface PubSubOpts<A, B, T> {
33
33
  * The actual topic (return value from `topic` fn) can be of any type `T`, or
34
34
  * `undefined`. If the latter is returned, the incoming value will not be
35
35
  * processed further. Complex topics (e.g objects / arrays) are allowed and
36
- * they're matched against registered topics using {@link @thi.ng/equiv#equiv}
37
- * by default (but customizable via `equiv` option). Each topic can have any
38
- * number of subscribers.
36
+ * they're matched against registered topics using
37
+ * [`equiv()`](https://docs.thi.ng/umbrella/equiv/functions/equiv.html) by
38
+ * default (but customizable via `equiv` option). Each topic can have any number
39
+ * of subscribers.
39
40
  *
40
41
  * If a `xform` transducer is given, it is always applied prior to passing the
41
42
  * input to the topic function. I.e. in this case the topic function will
package/pubsub.js CHANGED
@@ -12,9 +12,10 @@ import { Subscription, subscription } from "./subscription.js";
12
12
  * The actual topic (return value from `topic` fn) can be of any type `T`, or
13
13
  * `undefined`. If the latter is returned, the incoming value will not be
14
14
  * processed further. Complex topics (e.g objects / arrays) are allowed and
15
- * they're matched against registered topics using {@link @thi.ng/equiv#equiv}
16
- * by default (but customizable via `equiv` option). Each topic can have any
17
- * number of subscribers.
15
+ * they're matched against registered topics using
16
+ * [`equiv()`](https://docs.thi.ng/umbrella/equiv/functions/equiv.html) by
17
+ * default (but customizable via `equiv` option). Each topic can have any number
18
+ * of subscribers.
18
19
  *
19
20
  * If a `xform` transducer is given, it is always applied prior to passing the
20
21
  * input to the topic function. I.e. in this case the topic function will
package/stream.d.ts CHANGED
@@ -1,30 +1,29 @@
1
1
  import { CommonOpts, IStream, ISubscriber, ISubscription, StreamCancel, StreamSource, TransformableOpts, WithErrorHandlerOpts } from "./api.js";
2
2
  import { Subscription } from "./subscription.js";
3
3
  /**
4
- * Creates a new {@link Stream} instance, optionally with given
5
- * `StreamSource` function and / or options.
4
+ * Creates a new {@link Stream} instance, optionally with given `StreamSource`
5
+ * function and / or options.
6
6
  *
7
7
  * @remarks
8
- * If a `src` function is provided, the function will be only called
9
- * (with the `Stream` instance as single argument) once the first
10
- * subscriber has attached to the stream. If the function returns
11
- * another function, it will be used for cleanup purposes if the stream
12
- * is cancelled, e.g. if the first / last subscriber has unsubscribed
13
- * (depending on `closeOut` option). Streams are intended as (primarily
14
- * async) data sources in a dataflow graph and are the primary construct
15
- * for the various `from*()` functions provided by this package.
16
- * However, streams can also be triggered manually (from outside the
17
- * stream), in which case the user should call `stream.next()` to cause
18
- * value propagation.
8
+ * If a `src` function is provided, the function will be only called (with the
9
+ * `Stream` instance as single argument) once the first subscriber has attached
10
+ * to the stream. If the function returns another function, it will be used for
11
+ * cleanup purposes if the stream is cancelled, e.g. if the first / last
12
+ * subscriber has unsubscribed (depending on `closeOut` option). Streams are
13
+ * intended as (primarily async) data sources in a dataflow graph and are the
14
+ * primary construct for the various `from*()` functions provided by this
15
+ * package. However, streams can also be triggered manually (from outside the
16
+ * stream), in which case the user should call `stream.next()` to cause value
17
+ * propagation.
19
18
  *
20
19
  * Streams (like {@link Subscription}) implement the
21
- * {@link @thi.ng/api#IDeref} interface which provides read access to a
22
- * stream's last received value. This is useful for various purposes,
23
- * e.g. in combination with {@link @thi.ng/hdom# | @thi.ng/hdom}, which
24
- * supports direct embedding of streams (i.e. their values) into UI
25
- * components (and will be deref them automatically). If the stream has
26
- * not yet emitted a value, value caching is disabled or if the stream
27
- * is done, it will deref to `undefined`.
20
+ * [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html) interface
21
+ * which provides read access to a stream's last received value. This is useful
22
+ * for various purposes, e.g. in combination with
23
+ * [`thi.ng/hdom`](https://thi.ng/hdom), which supports direct embedding of
24
+ * streams (i.e. their values) into UI components (and will be deref them
25
+ * automatically). If the stream has not yet emitted a value, value caching is
26
+ * disabled or if the stream is done, it will deref to `undefined`.
28
27
  *
29
28
  * @example
30
29
  * ```ts
package/subscription.d.ts CHANGED
@@ -3,35 +3,34 @@ import type { Reducer, Transducer } from "@thi.ng/transducers";
3
3
  import { Reduced } from "@thi.ng/transducers/reduced";
4
4
  import { CloseMode, CommonOpts, ISubscriber, ISubscription, State, SubscriptionOpts, TransformableOpts, WithErrorHandlerOpts, WithTransform } from "./api.js";
5
5
  /**
6
- * Creates a new {@link Subscription} instance, the fundamental datatype
7
- * and building block provided by this package.
6
+ * Creates a new {@link Subscription} instance, the fundamental datatype and
7
+ * building block provided by this package.
8
8
  *
9
9
  * @remarks
10
- * Most other types in rstream, including {@link Stream}s, are
11
- * `Subscription`s and all can be:
10
+ * Most other types in rstream, including {@link Stream}s, are `Subscription`s
11
+ * and all can be:
12
12
  *
13
- * - connected into directed graphs (sync or async & not necessarily
14
- * DAGs)
13
+ * - connected into directed graphs (sync or async & not necessarily DAGs)
15
14
  * - transformed using transducers (incl. support for early termination)
16
15
  * - can have any number of subscribers (optionally each w/ their own
17
16
  * transducers)
18
- * - recursively unsubscribe themselves from parent after their last
19
- * subscriber unsubscribed (configurable)
20
- * - will go into a non-recoverable error state if none of the
21
- * subscribers has an error handler itself
22
- * - implement the {@link @thi.ng/api#IDeref} interface
17
+ * - recursively unsubscribe themselves from parent after their last subscriber
18
+ * unsubscribed (configurable)
19
+ * - will go into a non-recoverable error state if none of the subscribers has
20
+ * an error handler itself
21
+ * - implement the
22
+ * [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html)
23
+ * interface
23
24
  *
24
- * If a transducer is provided (via the `xform` option), all received
25
- * values will be first processed by the transducer and only its
26
- * transformed result(s) (if any) will be passed to downstream
27
- * subscribers. Any uncaught errors *inside* the transducer will cause
28
- * this subscription's error handler to be called and will stop this
29
- * subscription from receiving any further values (by default, unless
30
- * overridden).
25
+ * If a transducer is provided (via the `xform` option), all received values
26
+ * will be first processed by the transducer and only its transformed result(s)
27
+ * (if any) will be passed to downstream subscribers. Any uncaught errors
28
+ * *inside* the transducer will cause this subscription's error handler to be
29
+ * called and will stop this subscription from receiving any further values (by
30
+ * default, unless overridden).
31
31
  *
32
- * Subscription behavior can be customized via the additional (optional)
33
- * options arg. See {@link CommonOpts} and {@link SubscriptionOpts} for
34
- * further details.
32
+ * Subscription behavior can be customized via the additional (optional) options
33
+ * arg. See {@link CommonOpts} and {@link SubscriptionOpts} for further details.
35
34
  *
36
35
  * @example
37
36
  * ```ts
@@ -76,10 +75,10 @@ export declare class Subscription<A, B> implements ISubscription<A, B> {
76
75
  subscribe(sub: Partial<ISubscriber<B>>, opts?: Partial<CommonOpts>): ISubscription<B, B>;
77
76
  subscribe<C>(sub: Partial<ISubscriber<C>>, opts?: Partial<TransformableOpts<B, C>>): ISubscription<B, C>;
78
77
  /**
79
- * Creates a new child subscription using given transducers and
80
- * optional subscription ID. Supports up to 4 transducers and if
81
- * more than one transducer is given, composes them in left-to-right
82
- * order using {@link @thi.ng/transducers#(comp:1)}.
78
+ * Creates a new child subscription using given transducers and optional
79
+ * subscription ID. Supports up to 4 transducers and if more than one
80
+ * transducer is given, composes them in left-to-right order using
81
+ * [`comp()`](https://docs.thi.ng/umbrella/transducers/functions/comp.html).
83
82
  *
84
83
  * Shorthand for `subscribe(comp(xf1, xf2,...), id)`
85
84
  */
@@ -89,9 +88,10 @@ export declare class Subscription<A, B> implements ISubscription<A, B> {
89
88
  transform<C, D, E, F>(a: Transducer<B, C>, b: Transducer<C, D>, c: Transducer<D, E>, d: Transducer<E, F>, opts?: Partial<WithErrorHandlerOpts>): ISubscription<B, F>;
90
89
  transform<C>(opts: WithTransform<B, C> & Partial<WithErrorHandlerOpts>): ISubscription<B, C>;
91
90
  /**
92
- * Syntax sugar for {@link Subscription.transform} when using a
93
- * single {@link @thi.ng/transducers#map} transducer only. The given
94
- * function `fn` is used as `map`'s transformation fn.
91
+ * Syntax sugar for {@link Subscription.transform} when using a single
92
+ * [`map()`](https://docs.thi.ng/umbrella/transducers/functions/map.html)
93
+ * transducer only. The given function `fn` is used as `map`'s
94
+ * transformation fn.
95
95
  *
96
96
  * @param fn -
97
97
  * @param opts -
package/subscription.js CHANGED
@@ -12,35 +12,34 @@ import { CloseMode, State, } from "./api.js";
12
12
  import { __optsWithID } from "./idgen.js";
13
13
  import { LOGGER } from "./logger.js";
14
14
  /**
15
- * Creates a new {@link Subscription} instance, the fundamental datatype
16
- * and building block provided by this package.
15
+ * Creates a new {@link Subscription} instance, the fundamental datatype and
16
+ * building block provided by this package.
17
17
  *
18
18
  * @remarks
19
- * Most other types in rstream, including {@link Stream}s, are
20
- * `Subscription`s and all can be:
19
+ * Most other types in rstream, including {@link Stream}s, are `Subscription`s
20
+ * and all can be:
21
21
  *
22
- * - connected into directed graphs (sync or async & not necessarily
23
- * DAGs)
22
+ * - connected into directed graphs (sync or async & not necessarily DAGs)
24
23
  * - transformed using transducers (incl. support for early termination)
25
24
  * - can have any number of subscribers (optionally each w/ their own
26
25
  * transducers)
27
- * - recursively unsubscribe themselves from parent after their last
28
- * subscriber unsubscribed (configurable)
29
- * - will go into a non-recoverable error state if none of the
30
- * subscribers has an error handler itself
31
- * - implement the {@link @thi.ng/api#IDeref} interface
26
+ * - recursively unsubscribe themselves from parent after their last subscriber
27
+ * unsubscribed (configurable)
28
+ * - will go into a non-recoverable error state if none of the subscribers has
29
+ * an error handler itself
30
+ * - implement the
31
+ * [`IDeref`](https://docs.thi.ng/umbrella/api/interfaces/IDeref.html)
32
+ * interface
32
33
  *
33
- * If a transducer is provided (via the `xform` option), all received
34
- * values will be first processed by the transducer and only its
35
- * transformed result(s) (if any) will be passed to downstream
36
- * subscribers. Any uncaught errors *inside* the transducer will cause
37
- * this subscription's error handler to be called and will stop this
38
- * subscription from receiving any further values (by default, unless
39
- * overridden).
34
+ * If a transducer is provided (via the `xform` option), all received values
35
+ * will be first processed by the transducer and only its transformed result(s)
36
+ * (if any) will be passed to downstream subscribers. Any uncaught errors
37
+ * *inside* the transducer will cause this subscription's error handler to be
38
+ * called and will stop this subscription from receiving any further values (by
39
+ * default, unless overridden).
40
40
  *
41
- * Subscription behavior can be customized via the additional (optional)
42
- * options arg. See {@link CommonOpts} and {@link SubscriptionOpts} for
43
- * further details.
41
+ * Subscription behavior can be customized via the additional (optional) options
42
+ * arg. See {@link CommonOpts} and {@link SubscriptionOpts} for further details.
44
43
  *
45
44
  * @example
46
45
  * ```ts
@@ -124,9 +123,10 @@ export class Subscription {
124
123
  : opts));
125
124
  }
126
125
  /**
127
- * Syntax sugar for {@link Subscription.transform} when using a
128
- * single {@link @thi.ng/transducers#map} transducer only. The given
129
- * function `fn` is used as `map`'s transformation fn.
126
+ * Syntax sugar for {@link Subscription.transform} when using a single
127
+ * [`map()`](https://docs.thi.ng/umbrella/transducers/functions/map.html)
128
+ * transducer only. The given function `fn` is used as `map`'s
129
+ * transformation fn.
130
130
  *
131
131
  * @param fn -
132
132
  * @param opts -
package/sync.d.ts CHANGED
@@ -2,7 +2,7 @@ import type { Always, Derefed, IObjectOf } from "@thi.ng/api";
2
2
  import { PartitionSync } from "@thi.ng/transducers/partition-sync";
3
3
  import type { ISubscribable, ISubscription, TransformableOpts } from "./api.js";
4
4
  import { Subscription } from "./subscription.js";
5
- export declare type SyncTuple<T extends IObjectOf<ISubscribable<any>>> = {
5
+ export type SyncTuple<T extends IObjectOf<ISubscribable<any>>> = {
6
6
  [id in keyof T]: Always<Derefed<T[id]>>;
7
7
  };
8
8
  export interface StreamSyncOpts<A extends IObjectOf<ISubscribable<any>>, B = SyncTuple<A>> extends TransformableOpts<SyncTuple<A>, B> {
@@ -87,9 +87,9 @@ export interface StreamSyncOpts<A extends IObjectOf<ISubscribable<any>>, B = Syn
87
87
  * option to `false`.
88
88
  *
89
89
  * The synchronization is done via the
90
- * {@link @thi.ng/transducers#(partitionSync:1)} transducer from the
91
- * {@link @thi.ng/transducers# | @thi.ng/transducers} package. See this
92
- * function's docs for further details.
90
+ * [`partitionSync()`](https://docs.thi.ng/umbrella/transducers/functions/partitionSync-1.html)
91
+ * transducer from the [`thi.ng/transducers`](https://thi.ng/transducers)
92
+ * package. See this function's docs for further details.
93
93
  *
94
94
  * @example
95
95
  * ```ts
package/sync.js CHANGED
@@ -39,9 +39,9 @@ import { Subscription } from "./subscription.js";
39
39
  * option to `false`.
40
40
  *
41
41
  * The synchronization is done via the
42
- * {@link @thi.ng/transducers#(partitionSync:1)} transducer from the
43
- * {@link @thi.ng/transducers# | @thi.ng/transducers} package. See this
44
- * function's docs for further details.
42
+ * [`partitionSync()`](https://docs.thi.ng/umbrella/transducers/functions/partitionSync-1.html)
43
+ * transducer from the [`thi.ng/transducers`](https://thi.ng/transducers)
44
+ * package. See this function's docs for further details.
45
45
  *
46
46
  * @example
47
47
  * ```ts
package/tunnel.d.ts CHANGED
@@ -21,9 +21,9 @@ export interface TunnelOpts<A> {
21
21
  */
22
22
  id?: string;
23
23
  /**
24
- * Optional function to extract transferables from incoming stream
25
- * values, e.g. ArrayBuffers. See:
26
- * {@link https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage}
24
+ * Optional function to extract transferables from incoming stream values,
25
+ * e.g. ArrayBuffers. See:
26
+ * https://developer.mozilla.org/en-US/docs/Web/API/Worker/postMessage
27
27
  */
28
28
  transferables?: Fn<A, any[]>;
29
29
  /**
package/view.d.ts CHANGED
@@ -7,7 +7,7 @@ export interface FromViewOpts<P, A, B> extends Partial<CommonOpts> {
7
7
  tx?: Fn<A, B>;
8
8
  equiv?: Predicate2<A>;
9
9
  }
10
- export declare type FromViewUnsafeOpts<T> = FromViewOpts<Path, any, T>;
10
+ export type FromViewUnsafeOpts<T> = FromViewOpts<Path, any, T>;
11
11
  /**
12
12
  * Unchecked version of {@link fromView}. Paths can be given as string
13
13
  * or tuple.
@@ -39,30 +39,31 @@ export declare type FromViewUnsafeOpts<T> = FromViewOpts<Path, any, T>;
39
39
  */
40
40
  export declare const fromViewUnsafe: <T>(atom: ReadonlyAtom<any>, opts: FromViewUnsafeOpts<T>) => Stream<T extends undefined ? any : T>;
41
41
  /**
42
- * Similar to {@link fromAtom}, but creates a type checked, eager
43
- * derived view for a nested value in an Atom-like state container and
44
- * yields stream of its value changes.
42
+ * Similar to {@link fromAtom}, but creates a type checked, eager derived view
43
+ * for a nested value in an Atom-like state container and yields stream of its
44
+ * value changes.
45
45
  *
46
46
  * @remarks
47
- * Stream value type is inferred from target path or (if given), the
48
- * result type of the optional view transformer (`tx` option).
47
+ * Stream value type is inferred from target path or (if given), the result type
48
+ * of the optional view transformer (`tx` option).
49
49
  *
50
- * Views are readonly and more lightweight versions of
51
- * {@link @thi.ng/atom#Cursor | cursors}. The view checks for value
52
- * changes with given `equiv` predicate (default:
53
- * {@link @thi.ng/equiv#equiv}). If the predicate returns a falsy result
54
- * (i.e. there's a new value), the new value is emitted on the stream.
55
- * The first value emitted is always the (possibly transformed) current
56
- * value at the stream's start time (i.e. when the first subscriber
57
- * attaches).
50
+ * Views are readonly and more lightweight versions of [thi.ng/atom
51
+ * cursors](https://docs.thi.ng/umbrella/atom/classes/Cursor.html). The view
52
+ * checks for value changes with given `equiv` predicate (default:
53
+ * [`equiv()`](https://docs.thi.ng/umbrella/equiv/functions/equiv.html)). If the
54
+ * predicate returns a falsy result (i.e. there's a new value), the new value is
55
+ * emitted on the stream. The first value emitted is always the (possibly
56
+ * transformed) current value at the stream's start time (i.e. when the first
57
+ * subscriber attaches).
58
58
  *
59
59
  * If the `tx` option is given, the raw value is first passed to this
60
60
  * transformer function and its result emitted on the stream instead.
61
61
  *
62
62
  * When the stream is cancelled the view is destroyed as well.
63
63
  *
64
- * Also see {@link @thi.ng/atom#defView},
65
- * {@link @thi.ng/atom#defViewUnsafe}
64
+ * Also see
65
+ * [`defView()`](https://docs.thi.ng/umbrella/atom/functions/defView.html),
66
+ * [`defViewUnsafe()`](https://docs.thi.ng/umbrella/atom/functions/defViewUnsafe.html)
66
67
  *
67
68
  * @example
68
69
  * ```ts