@thi.ng/rstream 6.0.19 → 7.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/CHANGELOG.md +44 -703
- package/README.md +68 -50
- package/api.d.ts +2 -4
- package/api.js +0 -3
- package/{subs/asidechain.d.ts → asidechain.d.ts} +2 -2
- package/{subs/asidechain.js → asidechain.js} +2 -1
- package/{from/atom.d.ts → atom.d.ts} +2 -3
- package/{from/atom.js → atom.js} +8 -4
- package/{subs/bisect.d.ts → bisect.d.ts} +2 -2
- package/{subs/bisect.js → bisect.js} +3 -3
- package/{utils/checks.d.ts → checks.d.ts} +2 -1
- package/{utils/checks.js → checks.js} +3 -1
- package/{subs/debounce.d.ts → debounce.d.ts} +2 -2
- package/{subs/debounce.js → debounce.js} +7 -4
- package/defworker.d.ts +3 -0
- package/defworker.js +4 -0
- package/{from/event.d.ts → event.d.ts} +2 -2
- package/{from/event.js → event.js} +4 -4
- package/forkjoin.d.ts +2 -2
- package/forkjoin.js +8 -3
- package/idgen.d.ts +10 -0
- package/idgen.js +9 -0
- package/index.d.ts +35 -33
- package/index.js +35 -33
- package/internal/remove.d.ts +4 -0
- package/internal/remove.js +7 -0
- package/{from/interval.d.ts → interval.d.ts} +2 -3
- package/{from/interval.js → interval.js} +8 -5
- package/{from/iterable.d.ts → iterable.d.ts} +3 -4
- package/{from/iterable.js → iterable.js} +7 -7
- package/logger.d.ts +4 -0
- package/logger.js +3 -0
- package/{stream-merge.d.ts → merge.d.ts} +3 -3
- package/{stream-merge.js → merge.js} +8 -10
- package/metastream.d.ts +3 -3
- package/metastream.js +10 -5
- package/{from/object.d.ts → object.d.ts} +2 -2
- package/{from/object.js → object.js} +13 -6
- package/package.json +140 -31
- package/{subs/post-worker.d.ts → post-worker.d.ts} +1 -1
- package/{subs/post-worker.js → post-worker.js} +5 -4
- package/{from/promise.d.ts → promise.d.ts} +2 -3
- package/{from/promise.js → promise.js} +5 -5
- package/{from/promises.d.ts → promises.d.ts} +1 -1
- package/{from/promises.js → promises.js} +4 -4
- package/pubsub.d.ts +3 -3
- package/pubsub.js +14 -8
- package/{from/raf.d.ts → raf.d.ts} +2 -3
- package/{from/raf.js → raf.js} +6 -6
- package/{subs/resolve.d.ts → resolve.d.ts} +1 -1
- package/{subs/resolve.js → resolve.js} +7 -5
- package/{subs/sidechain-partition.d.ts → sidechain-partition.d.ts} +4 -4
- package/{subs/sidechain-partition.js → sidechain-partition.js} +8 -7
- package/{subs/sidechain-toggle.d.ts → sidechain-toggle.d.ts} +3 -3
- package/{subs/sidechain-toggle.js → sidechain-toggle.js} +5 -4
- package/stream.d.ts +2 -2
- package/stream.js +9 -5
- package/subscription.d.ts +4 -3
- package/subscription.js +37 -15
- package/{stream-sync.d.ts → sync.d.ts} +4 -4
- package/{stream-sync.js → sync.js} +33 -12
- package/{subs/timeout.d.ts → timeout.d.ts} +2 -2
- package/{subs/timeout.js → timeout.js} +8 -4
- package/{subs/trace.d.ts → trace.d.ts} +1 -1
- package/{subs/trace.js → trace.js} +0 -0
- package/{subs/transduce.d.ts → transduce.d.ts} +1 -1
- package/{subs/transduce.js → transduce.js} +1 -1
- package/trigger.d.ts +2 -2
- package/trigger.js +3 -3
- package/{subs/tunnel.d.ts → tunnel.d.ts} +1 -1
- package/{subs/tunnel.js → tunnel.js} +13 -6
- package/tween.d.ts +5 -5
- package/tween.js +8 -6
- package/{from/view.d.ts → view.d.ts} +3 -3
- package/{from/view.js → view.js} +4 -4
- package/{from/worker.d.ts → worker.d.ts} +2 -3
- package/{from/worker.js → worker.js} +7 -7
- package/lib/index.js +0 -1148
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
- package/utils/idgen.d.ts +0 -4
- package/utils/idgen.js +0 -3
- package/utils/worker.d.ts +0 -3
- package/utils/worker.js +0 -4
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { WithErrorHandlerOpts } from "
|
|
2
|
-
import { Stream } from "../stream";
|
|
1
|
+
import type { WithErrorHandlerOpts } from "./api.js";
|
|
3
2
|
export interface FromWorkerOpts extends WithErrorHandlerOpts {
|
|
4
3
|
/**
|
|
5
4
|
* If true, the worker will be terminated when the stream
|
|
@@ -32,5 +31,5 @@ export interface FromWorkerOpts extends WithErrorHandlerOpts {
|
|
|
32
31
|
* @param worker -
|
|
33
32
|
* @param opts -
|
|
34
33
|
*/
|
|
35
|
-
export declare const fromWorker: <T>(worker: Worker | Blob | string, opts?: Partial<FromWorkerOpts> | undefined) => Stream<T>;
|
|
34
|
+
export declare const fromWorker: <T>(worker: Worker | Blob | string, opts?: Partial<FromWorkerOpts> | undefined) => import("./stream.js").Stream<T>;
|
|
36
35
|
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { defWorker } from "./defworker.js";
|
|
2
|
+
import { __optsWithID } from "./idgen.js";
|
|
3
|
+
import { LOGGER } from "./logger.js";
|
|
4
|
+
import { stream } from "./stream.js";
|
|
5
5
|
/**
|
|
6
6
|
* Returns a {@link Stream} which adds `message` and `error` event
|
|
7
7
|
* listeners to given `worker` and then emits received values.
|
|
@@ -26,9 +26,9 @@ import { makeWorker } from "../utils/worker";
|
|
|
26
26
|
* @param opts -
|
|
27
27
|
*/
|
|
28
28
|
export const fromWorker = (worker, opts) => {
|
|
29
|
-
const _worker =
|
|
30
|
-
opts =
|
|
31
|
-
return
|
|
29
|
+
const _worker = defWorker(worker);
|
|
30
|
+
opts = __optsWithID("worker", opts);
|
|
31
|
+
return stream((stream) => {
|
|
32
32
|
const msgListener = (e) => {
|
|
33
33
|
stream.next(e.data);
|
|
34
34
|
};
|