@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.
Files changed (85) hide show
  1. package/CHANGELOG.md +44 -703
  2. package/README.md +68 -50
  3. package/api.d.ts +2 -4
  4. package/api.js +0 -3
  5. package/{subs/asidechain.d.ts → asidechain.d.ts} +2 -2
  6. package/{subs/asidechain.js → asidechain.js} +2 -1
  7. package/{from/atom.d.ts → atom.d.ts} +2 -3
  8. package/{from/atom.js → atom.js} +8 -4
  9. package/{subs/bisect.d.ts → bisect.d.ts} +2 -2
  10. package/{subs/bisect.js → bisect.js} +3 -3
  11. package/{utils/checks.d.ts → checks.d.ts} +2 -1
  12. package/{utils/checks.js → checks.js} +3 -1
  13. package/{subs/debounce.d.ts → debounce.d.ts} +2 -2
  14. package/{subs/debounce.js → debounce.js} +7 -4
  15. package/defworker.d.ts +3 -0
  16. package/defworker.js +4 -0
  17. package/{from/event.d.ts → event.d.ts} +2 -2
  18. package/{from/event.js → event.js} +4 -4
  19. package/forkjoin.d.ts +2 -2
  20. package/forkjoin.js +8 -3
  21. package/idgen.d.ts +10 -0
  22. package/idgen.js +9 -0
  23. package/index.d.ts +35 -33
  24. package/index.js +35 -33
  25. package/internal/remove.d.ts +4 -0
  26. package/internal/remove.js +7 -0
  27. package/{from/interval.d.ts → interval.d.ts} +2 -3
  28. package/{from/interval.js → interval.js} +8 -5
  29. package/{from/iterable.d.ts → iterable.d.ts} +3 -4
  30. package/{from/iterable.js → iterable.js} +7 -7
  31. package/logger.d.ts +4 -0
  32. package/logger.js +3 -0
  33. package/{stream-merge.d.ts → merge.d.ts} +3 -3
  34. package/{stream-merge.js → merge.js} +8 -10
  35. package/metastream.d.ts +3 -3
  36. package/metastream.js +10 -5
  37. package/{from/object.d.ts → object.d.ts} +2 -2
  38. package/{from/object.js → object.js} +13 -6
  39. package/package.json +140 -31
  40. package/{subs/post-worker.d.ts → post-worker.d.ts} +1 -1
  41. package/{subs/post-worker.js → post-worker.js} +5 -4
  42. package/{from/promise.d.ts → promise.d.ts} +2 -3
  43. package/{from/promise.js → promise.js} +5 -5
  44. package/{from/promises.d.ts → promises.d.ts} +1 -1
  45. package/{from/promises.js → promises.js} +4 -4
  46. package/pubsub.d.ts +3 -3
  47. package/pubsub.js +14 -8
  48. package/{from/raf.d.ts → raf.d.ts} +2 -3
  49. package/{from/raf.js → raf.js} +6 -6
  50. package/{subs/resolve.d.ts → resolve.d.ts} +1 -1
  51. package/{subs/resolve.js → resolve.js} +7 -5
  52. package/{subs/sidechain-partition.d.ts → sidechain-partition.d.ts} +4 -4
  53. package/{subs/sidechain-partition.js → sidechain-partition.js} +8 -7
  54. package/{subs/sidechain-toggle.d.ts → sidechain-toggle.d.ts} +3 -3
  55. package/{subs/sidechain-toggle.js → sidechain-toggle.js} +5 -4
  56. package/stream.d.ts +2 -2
  57. package/stream.js +9 -5
  58. package/subscription.d.ts +4 -3
  59. package/subscription.js +37 -15
  60. package/{stream-sync.d.ts → sync.d.ts} +4 -4
  61. package/{stream-sync.js → sync.js} +33 -12
  62. package/{subs/timeout.d.ts → timeout.d.ts} +2 -2
  63. package/{subs/timeout.js → timeout.js} +8 -4
  64. package/{subs/trace.d.ts → trace.d.ts} +1 -1
  65. package/{subs/trace.js → trace.js} +0 -0
  66. package/{subs/transduce.d.ts → transduce.d.ts} +1 -1
  67. package/{subs/transduce.js → transduce.js} +1 -1
  68. package/trigger.d.ts +2 -2
  69. package/trigger.js +3 -3
  70. package/{subs/tunnel.d.ts → tunnel.d.ts} +1 -1
  71. package/{subs/tunnel.js → tunnel.js} +13 -6
  72. package/tween.d.ts +5 -5
  73. package/tween.js +8 -6
  74. package/{from/view.d.ts → view.d.ts} +3 -3
  75. package/{from/view.js → view.js} +4 -4
  76. package/{from/worker.d.ts → worker.d.ts} +2 -3
  77. package/{from/worker.js → worker.js} +7 -7
  78. package/lib/index.js +0 -1148
  79. package/lib/index.js.map +0 -1
  80. package/lib/index.umd.js +0 -1
  81. package/lib/index.umd.js.map +0 -1
  82. package/utils/idgen.d.ts +0 -4
  83. package/utils/idgen.js +0 -3
  84. package/utils/worker.d.ts +0 -3
  85. package/utils/worker.js +0 -4
@@ -1,5 +1,4 @@
1
- import { WithErrorHandlerOpts } from "../api";
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 { LOGGER } from "../api";
2
- import { Stream } from "../stream";
3
- import { optsWithID } from "../utils/idgen";
4
- import { makeWorker } from "../utils/worker";
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 = makeWorker(worker);
30
- opts = optsWithID("worker", opts);
31
- return new Stream((stream) => {
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
  };