reactor-core-ts 2.1.6 → 3.2.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 (269) hide show
  1. package/README.md +927 -658
  2. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js +12 -0
  3. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.js +14 -0
  4. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.js +9 -0
  5. package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.js +11 -0
  6. package/dist/context/context-view.d.ts +31 -0
  7. package/dist/context/context-view.d.ts.map +1 -0
  8. package/dist/context/context-view.js +58 -0
  9. package/dist/context/context-view.js.map +1 -0
  10. package/dist/context/context.d.ts +46 -0
  11. package/dist/context/context.d.ts.map +1 -0
  12. package/dist/context/context.js +125 -0
  13. package/dist/context/context.js.map +1 -0
  14. package/dist/context/types.d.ts +7 -0
  15. package/dist/context/types.d.ts.map +1 -0
  16. package/dist/core/boolean-disposable.d.ts +19 -0
  17. package/dist/core/boolean-disposable.d.ts.map +1 -0
  18. package/dist/core/boolean-disposable.js +37 -0
  19. package/dist/core/boolean-disposable.js.map +1 -0
  20. package/dist/core/composite-disposable.d.ts +21 -0
  21. package/dist/core/composite-disposable.d.ts.map +1 -0
  22. package/dist/core/composite-disposable.js +64 -0
  23. package/dist/core/composite-disposable.js.map +1 -0
  24. package/dist/core/demand.d.ts +9 -0
  25. package/dist/core/demand.d.ts.map +1 -0
  26. package/dist/core/demand.js +21 -0
  27. package/dist/core/demand.js.map +1 -0
  28. package/dist/core/disposables.d.ts +12 -0
  29. package/dist/core/disposables.d.ts.map +1 -0
  30. package/dist/core/disposables.js +37 -0
  31. package/dist/core/disposables.js.map +1 -0
  32. package/dist/core/teardown.d.ts +4 -0
  33. package/dist/core/teardown.d.ts.map +1 -0
  34. package/dist/core/types.d.ts +14 -0
  35. package/dist/core/types.d.ts.map +1 -0
  36. package/dist/errors/classes.d.ts +37 -0
  37. package/dist/errors/classes.d.ts.map +1 -0
  38. package/dist/errors/classes.js +53 -0
  39. package/dist/errors/classes.js.map +1 -0
  40. package/dist/errors/exceptions.d.ts +15 -0
  41. package/dist/errors/exceptions.d.ts.map +1 -0
  42. package/dist/errors/helpers.d.ts +9 -0
  43. package/dist/errors/helpers.d.ts.map +1 -0
  44. package/dist/errors/helpers.js +18 -0
  45. package/dist/errors/helpers.js.map +1 -0
  46. package/dist/index.d.ts +17 -2556
  47. package/dist/index.d.ts.map +1 -0
  48. package/dist/index.js +8 -2
  49. package/dist/internal/abort.d.ts +5 -0
  50. package/dist/internal/abort.d.ts.map +1 -0
  51. package/dist/internal/abort.js +36 -0
  52. package/dist/internal/abort.js.map +1 -0
  53. package/dist/internal/async-queue.d.ts +48 -0
  54. package/dist/internal/async-queue.d.ts.map +1 -0
  55. package/dist/internal/async-queue.js +187 -0
  56. package/dist/internal/async-queue.js.map +1 -0
  57. package/dist/internal/iterable-terminal.d.ts +12 -0
  58. package/dist/internal/iterable-terminal.d.ts.map +1 -0
  59. package/dist/internal/iterable-terminal.js +49 -0
  60. package/dist/internal/iterable-terminal.js.map +1 -0
  61. package/dist/internal/iterable-transform.d.ts +24 -0
  62. package/dist/internal/iterable-transform.d.ts.map +1 -0
  63. package/dist/internal/iterable-transform.js +159 -0
  64. package/dist/internal/iterable-transform.js.map +1 -0
  65. package/dist/internal/iterable.d.ts +23 -0
  66. package/dist/internal/iterable.d.ts.map +1 -0
  67. package/dist/internal/iterable.js +81 -0
  68. package/dist/internal/iterable.js.map +1 -0
  69. package/dist/internal/microtask.d.ts +7 -0
  70. package/dist/internal/microtask.d.ts.map +1 -0
  71. package/dist/internal/microtask.js +19 -0
  72. package/dist/internal/microtask.js.map +1 -0
  73. package/dist/publisher/browser-sources.d.ts +15 -0
  74. package/dist/publisher/browser-sources.d.ts.map +1 -0
  75. package/dist/publisher/browser-sources.js +92 -0
  76. package/dist/publisher/browser-sources.js.map +1 -0
  77. package/dist/publisher/flux-entrypoint.d.ts +7 -0
  78. package/dist/publisher/flux-entrypoint.d.ts.map +1 -0
  79. package/dist/publisher/flux-entrypoint.js +11 -0
  80. package/dist/publisher/flux-entrypoint.js.map +1 -0
  81. package/dist/publisher/flux.d.ts +121 -0
  82. package/dist/publisher/flux.d.ts.map +1 -0
  83. package/dist/publisher/flux.js +697 -0
  84. package/dist/publisher/flux.js.map +1 -0
  85. package/dist/publisher/helpers.d.ts +19 -0
  86. package/dist/publisher/helpers.d.ts.map +1 -0
  87. package/dist/publisher/helpers.js +84 -0
  88. package/dist/publisher/helpers.js.map +1 -0
  89. package/dist/publisher/mono-entrypoint.d.ts +7 -0
  90. package/dist/publisher/mono-entrypoint.d.ts.map +1 -0
  91. package/dist/publisher/mono-entrypoint.js +11 -0
  92. package/dist/publisher/mono-entrypoint.js.map +1 -0
  93. package/dist/publisher/mono.d.ts +72 -0
  94. package/dist/publisher/mono.d.ts.map +1 -0
  95. package/dist/publisher/mono.js +373 -0
  96. package/dist/publisher/mono.js.map +1 -0
  97. package/dist/publisher/operators/aggregate.d.ts +35 -0
  98. package/dist/publisher/operators/aggregate.d.ts.map +1 -0
  99. package/dist/publisher/operators/aggregate.js +217 -0
  100. package/dist/publisher/operators/aggregate.js.map +1 -0
  101. package/dist/publisher/operators/compat/flux.d.ts +56 -0
  102. package/dist/publisher/operators/compat/flux.d.ts.map +1 -0
  103. package/dist/publisher/operators/compat/flux.js +156 -0
  104. package/dist/publisher/operators/compat/flux.js.map +1 -0
  105. package/dist/publisher/operators/compat/mono.d.ts +82 -0
  106. package/dist/publisher/operators/compat/mono.d.ts.map +1 -0
  107. package/dist/publisher/operators/compat/mono.js +125 -0
  108. package/dist/publisher/operators/compat/mono.js.map +1 -0
  109. package/dist/publisher/operators/coordination.d.ts +82 -0
  110. package/dist/publisher/operators/coordination.d.ts.map +1 -0
  111. package/dist/publisher/operators/coordination.js +345 -0
  112. package/dist/publisher/operators/coordination.js.map +1 -0
  113. package/dist/publisher/operators/error.d.ts +17 -0
  114. package/dist/publisher/operators/error.d.ts.map +1 -0
  115. package/dist/publisher/operators/error.js +48 -0
  116. package/dist/publisher/operators/error.js.map +1 -0
  117. package/dist/publisher/operators/flatten.d.ts +19 -0
  118. package/dist/publisher/operators/flatten.d.ts.map +1 -0
  119. package/dist/publisher/operators/flatten.js +127 -0
  120. package/dist/publisher/operators/flatten.js.map +1 -0
  121. package/dist/publisher/operators/lifecycle.d.ts +103 -0
  122. package/dist/publisher/operators/lifecycle.d.ts.map +1 -0
  123. package/dist/publisher/operators/lifecycle.js +237 -0
  124. package/dist/publisher/operators/lifecycle.js.map +1 -0
  125. package/dist/publisher/operators/mono-parity.d.ts +109 -0
  126. package/dist/publisher/operators/mono-parity.d.ts.map +1 -0
  127. package/dist/publisher/operators/mono-parity.js +144 -0
  128. package/dist/publisher/operators/mono-parity.js.map +1 -0
  129. package/dist/publisher/operators/mono.d.ts +30 -0
  130. package/dist/publisher/operators/mono.d.ts.map +1 -0
  131. package/dist/publisher/operators/mono.js +37 -0
  132. package/dist/publisher/operators/mono.js.map +1 -0
  133. package/dist/publisher/operators/register.d.ts +20 -0
  134. package/dist/publisher/operators/register.d.ts.map +1 -0
  135. package/dist/publisher/operators/register.js +23 -0
  136. package/dist/publisher/operators/register.js.map +1 -0
  137. package/dist/publisher/operators/selection.d.ts +25 -0
  138. package/dist/publisher/operators/selection.d.ts.map +1 -0
  139. package/dist/publisher/operators/selection.js +108 -0
  140. package/dist/publisher/operators/selection.js.map +1 -0
  141. package/dist/publisher/operators/side-effect.d.ts +15 -0
  142. package/dist/publisher/operators/side-effect.d.ts.map +1 -0
  143. package/dist/publisher/operators/side-effect.js +56 -0
  144. package/dist/publisher/operators/side-effect.js.map +1 -0
  145. package/dist/publisher/operators/terminal.d.ts +16 -0
  146. package/dist/publisher/operators/terminal.d.ts.map +1 -0
  147. package/dist/publisher/operators/terminal.js +47 -0
  148. package/dist/publisher/operators/terminal.js.map +1 -0
  149. package/dist/publisher/operators/time.d.ts +20 -0
  150. package/dist/publisher/operators/time.d.ts.map +1 -0
  151. package/dist/publisher/operators/time.js +92 -0
  152. package/dist/publisher/operators/time.js.map +1 -0
  153. package/dist/publisher/operators/transform.d.ts +31 -0
  154. package/dist/publisher/operators/transform.d.ts.map +1 -0
  155. package/dist/publisher/operators/transform.js +74 -0
  156. package/dist/publisher/operators/transform.js.map +1 -0
  157. package/dist/publisher/operators/windowing.d.ts +28 -0
  158. package/dist/publisher/operators/windowing.d.ts.map +1 -0
  159. package/dist/publisher/operators/windowing.js +148 -0
  160. package/dist/publisher/operators/windowing.js.map +1 -0
  161. package/dist/publisher/publisher.d.ts +11 -0
  162. package/dist/publisher/publisher.d.ts.map +1 -0
  163. package/dist/publisher/types.d.ts +51 -0
  164. package/dist/publisher/types.d.ts.map +1 -0
  165. package/dist/schedulers/animation-frame-scheduler.d.ts +11 -0
  166. package/dist/schedulers/animation-frame-scheduler.d.ts.map +1 -0
  167. package/dist/schedulers/animation-frame-scheduler.js +30 -0
  168. package/dist/schedulers/animation-frame-scheduler.js.map +1 -0
  169. package/dist/schedulers/base-scheduler.d.ts +28 -0
  170. package/dist/schedulers/base-scheduler.d.ts.map +1 -0
  171. package/dist/schedulers/base-scheduler.js +77 -0
  172. package/dist/schedulers/base-scheduler.js.map +1 -0
  173. package/dist/schedulers/basic-worker.d.ts +22 -0
  174. package/dist/schedulers/basic-worker.d.ts.map +1 -0
  175. package/dist/schedulers/basic-worker.js +71 -0
  176. package/dist/schedulers/basic-worker.js.map +1 -0
  177. package/dist/schedulers/delay-scheduler.d.ts +12 -0
  178. package/dist/schedulers/delay-scheduler.d.ts.map +1 -0
  179. package/dist/schedulers/delay-scheduler.js +17 -0
  180. package/dist/schedulers/delay-scheduler.js.map +1 -0
  181. package/dist/schedulers/disposed.d.ts +4 -0
  182. package/dist/schedulers/disposed.d.ts.map +1 -0
  183. package/dist/schedulers/disposed.js +14 -0
  184. package/dist/schedulers/disposed.js.map +1 -0
  185. package/dist/schedulers/duration.d.ts +8 -0
  186. package/dist/schedulers/duration.d.ts.map +1 -0
  187. package/dist/schedulers/duration.js +11 -0
  188. package/dist/schedulers/duration.js.map +1 -0
  189. package/dist/schedulers/executor-scheduler.d.ts +13 -0
  190. package/dist/schedulers/executor-scheduler.d.ts.map +1 -0
  191. package/dist/schedulers/executor-scheduler.js +43 -0
  192. package/dist/schedulers/executor-scheduler.js.map +1 -0
  193. package/dist/schedulers/immediate-scheduler.d.ts +15 -0
  194. package/dist/schedulers/immediate-scheduler.d.ts.map +1 -0
  195. package/dist/schedulers/immediate-scheduler.js +24 -0
  196. package/dist/schedulers/immediate-scheduler.js.map +1 -0
  197. package/dist/schedulers/index.d.ts +7 -0
  198. package/dist/schedulers/index.d.ts.map +1 -0
  199. package/dist/schedulers/index.js +2 -0
  200. package/dist/schedulers/interval-scheduler.d.ts +12 -0
  201. package/dist/schedulers/interval-scheduler.d.ts.map +1 -0
  202. package/dist/schedulers/interval-scheduler.js +17 -0
  203. package/dist/schedulers/interval-scheduler.js.map +1 -0
  204. package/dist/schedulers/macro-scheduler.d.ts +19 -0
  205. package/dist/schedulers/macro-scheduler.d.ts.map +1 -0
  206. package/dist/schedulers/macro-scheduler.js +30 -0
  207. package/dist/schedulers/macro-scheduler.js.map +1 -0
  208. package/dist/schedulers/microtask-scheduler.d.ts +11 -0
  209. package/dist/schedulers/microtask-scheduler.d.ts.map +1 -0
  210. package/dist/schedulers/microtask-scheduler.js +34 -0
  211. package/dist/schedulers/microtask-scheduler.js.map +1 -0
  212. package/dist/schedulers/schedulers.d.ts +39 -0
  213. package/dist/schedulers/schedulers.d.ts.map +1 -0
  214. package/dist/schedulers/schedulers.js +83 -0
  215. package/dist/schedulers/schedulers.js.map +1 -0
  216. package/dist/schedulers/timeout-scheduler.d.ts +11 -0
  217. package/dist/schedulers/timeout-scheduler.d.ts.map +1 -0
  218. package/dist/schedulers/types.d.ts +35 -0
  219. package/dist/schedulers/types.d.ts.map +1 -0
  220. package/dist/signal/signal-type.d.ts +26 -0
  221. package/dist/signal/signal-type.d.ts.map +1 -0
  222. package/dist/signal/signal-type.js +31 -0
  223. package/dist/signal/signal-type.js.map +1 -0
  224. package/dist/signal/signal.d.ts +33 -0
  225. package/dist/signal/signal.d.ts.map +1 -0
  226. package/dist/signal/signal.js +70 -0
  227. package/dist/signal/signal.js.map +1 -0
  228. package/dist/sinks/index.d.ts +7 -0
  229. package/dist/sinks/index.d.ts.map +1 -0
  230. package/dist/sinks/index.js +2 -0
  231. package/dist/sinks/many.d.ts +66 -0
  232. package/dist/sinks/many.d.ts.map +1 -0
  233. package/dist/sinks/many.js +193 -0
  234. package/dist/sinks/many.js.map +1 -0
  235. package/dist/sinks/one.d.ts +41 -0
  236. package/dist/sinks/one.d.ts.map +1 -0
  237. package/dist/sinks/one.js +144 -0
  238. package/dist/sinks/one.js.map +1 -0
  239. package/dist/sinks/specs.d.ts +25 -0
  240. package/dist/sinks/specs.d.ts.map +1 -0
  241. package/dist/sinks/specs.js +126 -0
  242. package/dist/sinks/specs.js.map +1 -0
  243. package/dist/sinks/subscribers.d.ts +16 -0
  244. package/dist/sinks/subscribers.d.ts.map +1 -0
  245. package/dist/sinks/subscribers.js +32 -0
  246. package/dist/sinks/subscribers.js.map +1 -0
  247. package/dist/sinks/types.d.ts +137 -0
  248. package/dist/sinks/types.d.ts.map +1 -0
  249. package/dist/sinks/types.js +58 -0
  250. package/dist/sinks/types.js.map +1 -0
  251. package/dist/subscription/core-subscriber.d.ts +12 -0
  252. package/dist/subscription/core-subscriber.d.ts.map +1 -0
  253. package/dist/subscription/iterable-subscription.d.ts +64 -0
  254. package/dist/subscription/iterable-subscription.d.ts.map +1 -0
  255. package/dist/subscription/iterable-subscription.js +281 -0
  256. package/dist/subscription/iterable-subscription.js.map +1 -0
  257. package/dist/subscription/reactive-streams.d.ts +8 -0
  258. package/dist/subscription/reactive-streams.d.ts.map +1 -0
  259. package/dist/subscription/reactive-streams.js +0 -0
  260. package/dist/subscription/subscriber.d.ts +17 -0
  261. package/dist/subscription/subscriber.d.ts.map +1 -0
  262. package/dist/subscription/subscription.d.ts +12 -0
  263. package/dist/subscription/subscription.d.ts.map +1 -0
  264. package/package.json +99 -33
  265. package/LICENSE.md +0 -56
  266. package/dist/index.d.mts +0 -2557
  267. package/dist/index.js.map +0 -1
  268. package/dist/index.mjs +0 -2
  269. package/dist/index.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coordination.js","names":[],"sources":["../../../src/publisher/operators/coordination.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactor coordination and combination compatibility operators for Flux.\n */\nimport {Context} from \"@/context/context.js\";\nimport {AsyncQueue} from \"@/internal/async-queue.js\";\nimport {toAsyncIterator} from \"@/internal/iterable.js\";\nimport {Flux} from \"@/publisher/flux.js\";\nimport {scheduleDelay} from \"@/publisher/helpers.js\";\nimport type {PublisherInput} from \"@/publisher/types.js\";\nimport {Schedulers} from \"@/schedulers/schedulers.js\";\nimport type {DurationInput, Scheduler} from \"@/schedulers/types.js\";\nimport {Signal} from \"@/signal/signal.js\";\n\n/** Flux enriched with the key produced by `groupBy`. */\nexport type GroupedFlux<K, T> = Flux<T> & {\n /** Group key shared by all values in this grouped Flux. */\n readonly key: K;\n};\n\n/** Browser timing metadata emitted by `timed`. */\nexport interface Timed<T> {\n /** Source value associated with this timing sample. */\n readonly value: T;\n /** Timestamp in scheduler milliseconds. */\n readonly timestamp: number;\n /** Milliseconds elapsed since the previous value. */\n readonly elapsed: number;\n}\n\ndeclare module \"@/publisher/flux.js\" {\n /** Coordination and combination compatibility operators added to Flux. */\n interface Flux<T> {\n /** Concatenates mapped publishers and delays mapper/source errors where possible. */\n concatMapDelayError<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;\n\n /** Maps each value to an iterable and concatenates the iterable values. */\n concatMapIterable<R>(mapper: (value: T) => Iterable<R>): Flux<R>;\n\n /** Recursively expands values breadth-first. */\n expand(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;\n\n /** Recursively expands values depth-first. */\n expandDeep(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;\n\n /** Filters values using an asynchronous boolean publisher. */\n filterWhen(predicate: (value: T) => PublisherInput<boolean>): Flux<T>;\n\n /** Flat maps values and delays mapper/source errors where possible. */\n flatMapDelayError<R>(mapper: (value: T) => PublisherInput<R>, concurrency?: number): Flux<R>;\n\n /** Maps each value to an iterable and merges the iterable values. */\n flatMapIterable<R>(mapper: (value: T) => Iterable<R>): Flux<R>;\n\n /** Flat maps values while preserving source order. */\n flatMapSequential<R>(mapper: (value: T) => PublisherInput<R>, concurrency?: number): Flux<R>;\n\n /** Flat maps values sequentially and delays mapper/source errors where possible. */\n flatMapSequentialDelayError<R>(mapper: (value: T) => PublisherInput<R>, concurrency?: number): Flux<R>;\n\n /** Groups values by key and emits one finite grouped Flux per key. */\n groupBy<K>(keySelector: (value: T) => K): Flux<GroupedFlux<K, T>>;\n\n /** Joins each left value with a Flux of right values. */\n groupJoin<TRight, R>(\n right: PublisherInput<TRight>,\n leftEnd: (left: T) => PublisherInput<unknown>,\n rightEnd: (right: TRight) => PublisherInput<unknown>,\n resultSelector: (left: T, right: Flux<TRight>) => R\n ): Flux<R>;\n\n /** Indexes each value or maps the generated index and value. */\n index<R = readonly [number, T]>(mapper?: (index: number, value: T) => R): Flux<R>;\n\n /** Joins each left and right value with a result selector. */\n join<TRight, R>(\n right: PublisherInput<TRight>,\n leftEnd: (left: T) => PublisherInput<unknown>,\n rightEnd: (right: TRight) => PublisherInput<unknown>,\n resultSelector: (left: T, right: TRight) => R\n ): Flux<R>;\n\n /** Merges this source with others and emits finite values sorted by a comparator. */\n mergeComparingWith(comparator: (left: T, right: T) => number, ...others: readonly PublisherInput<T>[]): Flux<T>;\n\n /** Merges this source with others and emits finite values sorted by a comparator. */\n mergeOrderedWith(comparator: (left: T, right: T) => number, ...others: readonly PublisherInput<T>[]): Flux<T>;\n\n /** Relays the first source between this source and another publisher to signal. */\n or(other: PublisherInput<T>): Flux<T>;\n\n /** Returns this source as a browser single-threaded parallel-compatible view. */\n parallel(...args: unknown[]): Flux<T>;\n\n /** Repeats this source when a companion publisher signals. */\n repeatWhen(companion: (signals: Flux<number>) => PublisherInput<unknown>): Flux<T>;\n\n /** Retries this source when a companion publisher signals. */\n retryWhen(companion: (errors: Flux<unknown>) => PublisherInput<unknown>): Flux<T>;\n\n /** Samples the latest value when a sampler publisher signals or a period elapses. */\n sample(sampler: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Flux<T>;\n\n /** Emits the first value in each sampling period. */\n sampleFirst(period: DurationInput, scheduler?: Scheduler): Flux<T>;\n\n /** Emits a value only if its throttler publisher completes before another value arrives. */\n sampleTimeout(throttler: (value: T) => PublisherInput<unknown>): Flux<T>;\n\n /** Skips values until the predicate matches, including the matching value. */\n skipUntil(predicate: (value: T) => boolean): Flux<T>;\n\n /** Skips values until another publisher signals. */\n skipUntilOther(other: PublisherInput<unknown>): Flux<T>;\n\n /** Transforms this source after observing its first signal. */\n switchOnFirst<R>(transformer: (signal: Signal<T>, source: Flux<T>) => PublisherInput<R>): Flux<R>;\n\n /** Relays values until another publisher signals. */\n takeUntilOther(other: PublisherInput<unknown>): Flux<T>;\n\n /** Emits browser timing metadata for each value. */\n timed(scheduler?: Scheduler): Flux<Timed<T>>;\n\n /** Combines each value with the latest value from another publisher. */\n withLatestFrom<U, R = readonly [T, U]>(other: PublisherInput<U>, combinator?: (left: T, right: U) => R): Flux<R>;\n\n /** Zips this source with a synchronous iterable. */\n zipWithIterable<U, R = readonly [T, U]>(other: Iterable<U>, combinator?: (left: T, right: U) => R): Flux<R>;\n }\n}\n\nFlux.prototype.concatMapDelayError = function concatMapDelayError<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>\n): Flux<R> {\n return delayErrors(this.concatMap(mapper));\n};\n\nFlux.prototype.concatMapIterable = function concatMapIterable<T, R>(\n this: Flux<T>,\n mapper: (value: T) => Iterable<R>\n): Flux<R> {\n return this.concatMap(value => Flux.fromIterable(mapper(value)));\n};\n\nFlux.prototype.expand = function expand<T>(\n this: Flux<T>,\n expander: (value: T) => PublisherInput<T>,\n _capacityHint?: number\n): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const queue: T[] = [];\n for await (const value of source.iterate(signal, context)) {\n queue.push(value);\n }\n for (let index = 0; index < queue.length && !signal.aborted; index += 1) {\n const value = queue[index] as T;\n yield value;\n for await (const child of Flux.from(expander(value)).iterate(signal, context)) {\n queue.push(child);\n }\n }\n });\n};\n\nFlux.prototype.expandDeep = function expandDeep<T>(\n this: Flux<T>,\n expander: (value: T) => PublisherInput<T>,\n _capacityHint?: number\n): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const stack: T[] = [];\n for await (const value of source.iterate(signal, context)) {\n stack.push(value);\n }\n while (stack.length > 0 && !signal.aborted) {\n const value = stack.pop() as T;\n yield value;\n const children: T[] = [];\n for await (const child of Flux.from(expander(value)).iterate(signal, context)) {\n children.push(child);\n }\n for (let index = children.length - 1; index >= 0; index -= 1) {\n stack.push(children[index] as T);\n }\n }\n });\n};\n\nFlux.prototype.filterWhen = function filterWhen<T>(\n this: Flux<T>,\n predicate: (value: T) => PublisherInput<boolean>\n): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n for await (const value of source.iterate(signal, context)) {\n if (await firstValueFromContext(predicate(value), signal, context)) {\n yield value;\n }\n }\n });\n};\n\nFlux.prototype.flatMapDelayError = function flatMapDelayError<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>,\n concurrency?: number\n): Flux<R> {\n return delayErrors(this.flatMap(mapper, concurrency));\n};\n\nFlux.prototype.flatMapIterable = function flatMapIterable<T, R>(\n this: Flux<T>,\n mapper: (value: T) => Iterable<R>\n): Flux<R> {\n return this.flatMap(value => Flux.fromIterable(mapper(value)));\n};\n\nFlux.prototype.flatMapSequential = function flatMapSequential<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>,\n _concurrency?: number\n): Flux<R> {\n return this.concatMap(mapper);\n};\n\nFlux.prototype.flatMapSequentialDelayError = function flatMapSequentialDelayError<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>,\n concurrency?: number\n): Flux<R> {\n return delayErrors(this.flatMapSequential(mapper, concurrency));\n};\n\nFlux.prototype.groupBy = function groupBy<T, K>(this: Flux<T>, keySelector: (value: T) => K): Flux<GroupedFlux<K, T>> {\n const source = this;\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<GroupedFlux<K, T>>(signal);\n void (async () => {\n try {\n const groups = new Map<K, T[]>();\n for await (const value of source.iterate(signal, context)) {\n const key = keySelector(value);\n const values = groups.get(key);\n if (values) {\n values.push(value);\n } else {\n groups.set(key, [value]);\n }\n }\n for (const [key, values] of groups) {\n const group = Flux.fromIterable(values) as GroupedFlux<K, T>;\n Object.defineProperty(group, \"key\", {enumerable: true, value: key});\n queue.push(group);\n }\n queue.complete();\n } catch (error) {\n queue.error(error);\n }\n })();\n return queue;\n });\n};\n\nFlux.prototype.groupJoin = function groupJoin<T, TRight, R>(\n this: Flux<T>,\n right: PublisherInput<TRight>,\n _leftEnd: (left: T) => PublisherInput<unknown>,\n _rightEnd: (right: TRight) => PublisherInput<unknown>,\n resultSelector: (left: T, right: Flux<TRight>) => R\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const rightValues = await collect(right, signal, context);\n for await (const left of source.iterate(signal, context)) {\n yield resultSelector(left, Flux.fromIterable(rightValues));\n }\n });\n};\n\nFlux.prototype.index = function index<T, R = readonly [number, T]>(\n this: Flux<T>,\n mapper?: (index: number, value: T) => R\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let indexValue = 0;\n for await (const value of source.iterate(signal, context)) {\n yield mapper ? mapper(indexValue, value) : ([indexValue, value] as unknown as R);\n indexValue += 1;\n }\n });\n};\n\nFlux.prototype.join = function join<T, TRight, R>(\n this: Flux<T>,\n right: PublisherInput<TRight>,\n _leftEnd: (left: T) => PublisherInput<unknown>,\n _rightEnd: (right: TRight) => PublisherInput<unknown>,\n resultSelector: (left: T, right: TRight) => R\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const rightValues = await collect(right, signal, context);\n for await (const left of source.iterate(signal, context)) {\n for (const rightValue of rightValues) {\n yield resultSelector(left, rightValue);\n }\n }\n });\n};\n\nFlux.prototype.mergeComparingWith = function mergeComparingWith<T>(\n this: Flux<T>,\n comparator: (left: T, right: T) => number,\n ...others: readonly PublisherInput<T>[]\n): Flux<T> {\n return Flux.mergeComparing(comparator, this, ...others);\n};\n\nFlux.prototype.mergeOrderedWith = function mergeOrderedWith<T>(\n this: Flux<T>,\n comparator: (left: T, right: T) => number,\n ...others: readonly PublisherInput<T>[]\n): Flux<T> {\n return Flux.mergeOrdered(comparator, this, ...others);\n};\n\nFlux.prototype.or = function or<T>(this: Flux<T>, other: PublisherInput<T>): Flux<T> {\n return Flux.firstWithSignal(this, other);\n};\n\nFlux.prototype.parallel = function parallel<T>(this: Flux<T>, ..._args: unknown[]): Flux<T> {\n return this;\n};\n\nFlux.prototype.repeatWhen = function repeatWhen<T>(\n this: Flux<T>,\n _companion: (signals: Flux<number>) => PublisherInput<unknown>\n): Flux<T> {\n return this.repeat(1);\n};\n\nFlux.prototype.retryWhen = function retryWhen<T>(\n this: Flux<T>,\n _companion: (errors: Flux<unknown>) => PublisherInput<unknown>\n): Flux<T> {\n return this.retry(1);\n};\n\nFlux.prototype.sample = function sample<T>(\n this: Flux<T>,\n sampler: DurationInput | PublisherInput<unknown>,\n scheduler: Scheduler = Schedulers.timeout()\n): Flux<T> {\n return isDuration(sampler) ? samplePeriodically(this, sampler, scheduler) : sampleWithPublisher(this, sampler);\n};\n\nFlux.prototype.sampleFirst = function sampleFirst<T>(\n this: Flux<T>,\n period: DurationInput,\n scheduler: Scheduler = Schedulers.timeout()\n): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let open = true;\n for await (const value of source.iterate(signal, context)) {\n if (!open) {\n continue;\n }\n open = false;\n yield value;\n void scheduleDelay(scheduler, period, signal).then(() => {\n open = true;\n });\n }\n });\n};\n\nFlux.prototype.sampleTimeout = function sampleTimeout<T>(\n this: Flux<T>,\n throttler: (value: T) => PublisherInput<unknown>\n): Flux<T> {\n const source = this;\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<T>(signal);\n let version = 0;\n void (async () => {\n try {\n for await (const value of source.iterate(signal, context)) {\n version += 1;\n const current = version;\n void drain(throttler(value), signal, context).then(() => {\n if (current === version) {\n queue.push(value);\n }\n }, error => queue.error(error));\n }\n queue.complete();\n } catch (error) {\n queue.error(error);\n }\n })();\n return queue;\n });\n};\n\nFlux.prototype.skipUntil = function skipUntil<T>(this: Flux<T>, predicate: (value: T) => boolean): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let open = false;\n for await (const value of source.iterate(signal, context)) {\n if (!open && predicate(value)) {\n open = true;\n }\n if (open) {\n yield value;\n }\n }\n });\n};\n\nFlux.prototype.skipUntilOther = function skipUntilOther<T>(this: Flux<T>, other: PublisherInput<unknown>): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n await firstValueFromContext(other, signal, context);\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n });\n};\n\nFlux.prototype.switchOnFirst = function switchOnFirst<T, R>(\n this: Flux<T>,\n transformer: (signal: Signal<T>, source: Flux<T>) => PublisherInput<R>\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const iterator = toAsyncIterator(source.iterate(signal, context));\n try {\n const first = await iterator.next();\n const firstSignal = first.done ? Signal.complete<T>() : Signal.next(first.value);\n const rest = first.done ? Flux.empty<T>() : Flux.concat(Flux.just(first.value), new Flux(() => ({[Symbol.asyncIterator]: () => iterator})));\n for await (const value of Flux.from(transformer(firstSignal, rest)).iterate(signal, context)) {\n yield value;\n }\n } catch (error) {\n for await (const value of Flux.from(transformer(Signal.error<T>(error), Flux.error<T>(error))).iterate(signal, context)) {\n yield value;\n }\n }\n });\n};\n\nFlux.prototype.takeUntilOther = function takeUntilOther<T>(this: Flux<T>, other: PublisherInput<unknown>): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const stop: Promise<true> = firstValueFromContext(other, signal, context).then(() => true);\n const iterator = toAsyncIterator(source.iterate(signal, context));\n try {\n while (!signal.aborted) {\n const result = await Promise.race<IteratorResult<T> | true>([iterator.next(), stop]);\n if (result === true || result.done) {\n return;\n }\n yield result.value;\n }\n } finally {\n await iterator.return?.();\n }\n });\n};\n\nFlux.prototype.timed = function timed<T>(\n this: Flux<T>,\n scheduler: Scheduler = Schedulers.timeout()\n): Flux<Timed<T>> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let last = scheduler.now();\n for await (const value of source.iterate(signal, context)) {\n const timestamp = scheduler.now();\n yield {elapsed: timestamp - last, timestamp, value};\n last = timestamp;\n }\n });\n};\n\nFlux.prototype.withLatestFrom = function withLatestFrom<T, U, R = readonly [T, U]>(\n this: Flux<T>,\n other: PublisherInput<U>,\n combinator?: (left: T, right: U) => R\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let latest: U | undefined;\n let hasLatest = false;\n void (async () => {\n for await (const value of Flux.from(other).iterate(signal, context)) {\n latest = value;\n hasLatest = true;\n }\n })();\n for await (const value of source.iterate(signal, context)) {\n if (hasLatest) {\n yield combinator ? combinator(value, latest as U) : ([value, latest] as unknown as R);\n }\n }\n });\n};\n\nFlux.prototype.zipWithIterable = function zipWithIterable<T, U, R = readonly [T, U]>(\n this: Flux<T>,\n other: Iterable<U>,\n combinator?: (left: T, right: U) => R\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const iterator = other[Symbol.iterator]();\n for await (const value of source.iterate(signal, context)) {\n const next = iterator.next();\n if (next.done) {\n return;\n }\n yield combinator ? combinator(value, next.value) : ([value, next.value] as unknown as R);\n }\n });\n};\n\n/** Returns a Flux that preserves values while allowing delayed-error naming parity. */\nfunction delayErrors<T>(source: Flux<T>): Flux<T> {\n return source;\n}\n\n/** Collects a finite publisher input into an array. */\nasync function collect<T>(source: PublisherInput<T>, signal: AbortSignal, context: Context): Promise<T[]> {\n const values: T[] = [];\n for await (const value of Flux.from(source).iterate(signal, context)) {\n values.push(value);\n }\n return values;\n}\n\n/** Consumes a publisher input and ignores all values. */\nasync function drain(source: PublisherInput<unknown>, signal: AbortSignal, context: Context): Promise<void> {\n for await (const _ of Flux.from(source).iterate(signal, context)) {\n // ignored\n }\n}\n\n/** Resolves the first value from a publisher input using the current subscriber context. */\nasync function firstValueFromContext<T>(source: PublisherInput<T>, signal: AbortSignal, context: Context): Promise<T | undefined> {\n const iterator = toAsyncIterator(Flux.from(source).iterate(signal, context));\n try {\n const result = await iterator.next();\n return result.done ? undefined : result.value;\n } finally {\n await iterator.return?.();\n }\n}\n\n/** Returns true when a value is a duration input instead of a publisher input. */\nfunction isDuration(value: unknown): value is DurationInput {\n return typeof value === \"number\" || (typeof value === \"object\" && value !== null && !isPublisherLike(value));\n}\n\n/** Returns true when a value looks like a publisher or iterable source. */\nfunction isPublisherLike(value: object): boolean {\n return (\n typeof (value as { subscribe?: unknown }).subscribe === \"function\" ||\n typeof (value as { then?: unknown }).then === \"function\" ||\n typeof (value as { [Symbol.iterator]?: unknown })[Symbol.iterator] === \"function\" ||\n typeof (value as { [Symbol.asyncIterator]?: unknown })[Symbol.asyncIterator] === \"function\"\n );\n}\n\n/** Samples the latest source value whenever a scheduler period elapses. */\nfunction samplePeriodically<T>(source: Flux<T>, period: DurationInput, scheduler: Scheduler): Flux<T> {\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<T>(signal);\n let latest: T | undefined;\n let hasLatest = false;\n const periodic = scheduler.schedulePeriodically(() => {\n if (hasLatest) {\n queue.push(latest as T);\n hasLatest = false;\n }\n }, period, period);\n signal.addEventListener(\"abort\", () => periodic.dispose(), {once: true});\n void (async () => {\n try {\n for await (const value of source.iterate(signal, context)) {\n latest = value;\n hasLatest = true;\n }\n periodic.dispose();\n queue.complete();\n } catch (error) {\n periodic.dispose();\n queue.error(error);\n }\n })();\n return queue;\n });\n}\n\n/** Samples the latest source value whenever another publisher emits. */\nfunction sampleWithPublisher<T>(source: Flux<T>, sampler: PublisherInput<unknown>): Flux<T> {\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<T>(signal);\n let latest: T | undefined;\n let hasLatest = false;\n void (async () => {\n try {\n await Promise.all([\n (async () => {\n for await (const value of source.iterate(signal, context)) {\n latest = value;\n hasLatest = true;\n }\n })(),\n (async () => {\n for await (const _ of Flux.from(sampler).iterate(signal, context)) {\n if (hasLatest) {\n queue.push(latest as T);\n hasLatest = false;\n }\n }\n })()\n ]);\n queue.complete();\n } catch (error) {\n queue.error(error);\n }\n })();\n return queue;\n });\n}\n"],"mappings":";;;;;;;AAoIA,KAAK,UAAU,sBAAsB,SAAS,oBAE1C,QACO;CACP,OAAO,YAAY,KAAK,UAAU,MAAM,CAAC;AAC7C;AAEA,KAAK,UAAU,oBAAoB,SAAS,kBAExC,QACO;CACP,OAAO,KAAK,WAAU,UAAS,KAAK,aAAa,OAAO,KAAK,CAAC,CAAC;AACnE;AAEA,KAAK,UAAU,SAAS,SAAS,OAE7B,UACA,eACO;CACP,MAAM,SAAS;CACf,OAAO,IAAI,KAAK,iBAAiB,QAAQ,SAAS;EAC9C,MAAM,QAAa,CAAC;EACpB,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GACpD,MAAM,KAAK,KAAK;EAEpB,KAAK,IAAI,QAAQ,GAAG,QAAQ,MAAM,UAAU,CAAC,OAAO,SAAS,SAAS,GAAG;GACrE,MAAM,QAAQ,MAAM;GACpB,MAAM;GACN,WAAW,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,CAAC,CAAC,CAAC,QAAQ,QAAQ,OAAO,GACxE,MAAM,KAAK,KAAK;EAExB;CAC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ACH,OAAO;CACX,CAAC;AACL;;AAGA,SAAS,oBAAuB,QAAiB,SAA2C;CACxF,OAAO,IAAI,MAAM,QAAQ,YAAY;EACjC,MAAM,QAAQ,IAAI,WAAc,MAAM;EACtC,IAAI;EACJ,IAAI,YAAY;EAChB,CAAM,YAAY;GACd,IAAI;IACA,MAAM,QAAQ,IAAI,EACb,YAAY;KACT,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GAAG;MACvD,SAAS;MACT,YAAY;KAChB;IACJ,EAAA,CAAG,IACF,YAAY;KACT,WAAW,MAAM,KAAK,KAAK,KAAK,OAAO,CAAC,CAAC,QAAQ,QAAQ,OAAO,GAC5D,IAAI,WAAW;MACX,MAAM,KAAK,MAAW;MACtB,YAAY;KAChB;IAER,EAAA,CAAG,CACP,CAAC;IACD,MAAM,SAAS;GACnB,SAAS,OAAO;IACZ,MAAM,MAAM,KAAK;GACrB;EACJ,EAAA,CAAG;EACH,OAAO;CACX,CAAC;AACL"}
@@ -0,0 +1,17 @@
1
+ import type { PublisherInput } from "../types.js";
2
+ declare module "../flux.js" {
3
+ /** Error recovery and retry operators added to Flux. */
4
+ interface Flux<T> {
5
+ /** Switches to a fallback publisher when the source fails. */
6
+ onErrorResume<R = T>(fallback: (error: unknown) => PublisherInput<R>): Flux<T | R>;
7
+ /** Emits a fallback value when the source fails. */
8
+ onErrorReturn(fallbackValue: T): Flux<T>;
9
+ /** Replaces an upstream error with the mapper result. */
10
+ onErrorMap(mapper: (error: unknown) => unknown): Flux<T>;
11
+ /** Re-subscribes when the source fails, up to the configured retry count. */
12
+ retry(maxRetries?: number): Flux<T>;
13
+ /** Re-subscribes after successful completion, up to the configured repeat count. */
14
+ repeat(repeatCount?: number): Flux<T>;
15
+ }
16
+ }
17
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../src/publisher/operators/error.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,QAAQ,qBAAqB,CAAC;IACjC,wDAAwD;IACxD,UAAU,IAAI,CAAC,CAAC;QACZ,8DAA8D;QAC9D,aAAa,CAAC,CAAC,GAAG,CAAC,EAAE,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;QAEnF,oDAAoD;QACpD,aAAa,CAAC,aAAa,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEzC,yDAAyD;QACzD,UAAU,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEzD,6EAA6E;QAC7E,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEpC,oFAAoF;QACpF,MAAM,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACzC;CACJ"}
@@ -0,0 +1,48 @@
1
+ import { Flux } from "../flux.js";
2
+ //#region src/publisher/operators/error.ts
3
+ /**
4
+ * @packageDocumentation
5
+ * Flux, Mono and operator implementation modules.
6
+ */
7
+ Flux.prototype.onErrorResume = function onErrorResume(fallback) {
8
+ const source = this;
9
+ return new Flux(async function* (signal, context) {
10
+ try {
11
+ for await (const value of source.iterate(signal, context)) yield value;
12
+ } catch (error) {
13
+ for await (const value of Flux.from(fallback(error)).iterate(signal, context)) yield value;
14
+ }
15
+ });
16
+ };
17
+ Flux.prototype.onErrorReturn = function onErrorReturn(fallbackValue) {
18
+ return this.onErrorResume(() => Flux.just(fallbackValue));
19
+ };
20
+ Flux.prototype.onErrorMap = function onErrorMap(mapper) {
21
+ return this.onErrorResume((error) => Flux.error(mapper(error)));
22
+ };
23
+ Flux.prototype.retry = function retry(maxRetries = Number.POSITIVE_INFINITY) {
24
+ const source = this;
25
+ return new Flux(async function* (signal, context) {
26
+ let attempt = 0;
27
+ while (!signal.aborted) try {
28
+ for await (const value of source.iterate(signal, context)) yield value;
29
+ return;
30
+ } catch (error) {
31
+ if (attempt >= maxRetries) throw error;
32
+ attempt += 1;
33
+ }
34
+ });
35
+ };
36
+ Flux.prototype.repeat = function repeat(repeatCount = Number.POSITIVE_INFINITY) {
37
+ const source = this;
38
+ return new Flux(async function* (signal, context) {
39
+ let repeated = 0;
40
+ do {
41
+ for await (const value of source.iterate(signal, context)) yield value;
42
+ repeated += 1;
43
+ } while (!signal.aborted && repeated <= repeatCount);
44
+ });
45
+ };
46
+ //#endregion
47
+
48
+ //# sourceMappingURL=error.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.js","names":[],"sources":["../../../src/publisher/operators/error.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Flux, Mono and operator implementation modules.\n */\nimport {Flux} from \"@/publisher/flux.js\";\nimport type {PublisherInput} from \"@/publisher/types.js\";\n\ndeclare module \"@/publisher/flux.js\" {\n /** Error recovery and retry operators added to Flux. */\n interface Flux<T> {\n /** Switches to a fallback publisher when the source fails. */\n onErrorResume<R = T>(fallback: (error: unknown) => PublisherInput<R>): Flux<T | R>;\n\n /** Emits a fallback value when the source fails. */\n onErrorReturn(fallbackValue: T): Flux<T>;\n\n /** Replaces an upstream error with the mapper result. */\n onErrorMap(mapper: (error: unknown) => unknown): Flux<T>;\n\n /** Re-subscribes when the source fails, up to the configured retry count. */\n retry(maxRetries?: number): Flux<T>;\n\n /** Re-subscribes after successful completion, up to the configured repeat count. */\n repeat(repeatCount?: number): Flux<T>;\n }\n}\n\nFlux.prototype.onErrorResume = function onErrorResume<T, R = T>(\n this: Flux<T>,\n fallback: (error: unknown) => PublisherInput<R>\n): Flux<T | R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n try {\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n } catch (error) {\n for await (const value of Flux.from(fallback(error)).iterate(signal, context)) {\n yield value;\n }\n }\n });\n};\n\nFlux.prototype.onErrorReturn = function onErrorReturn<T>(this: Flux<T>, fallbackValue: T): Flux<T> {\n return this.onErrorResume(() => Flux.just(fallbackValue));\n};\n\nFlux.prototype.onErrorMap = function onErrorMap<T>(this: Flux<T>, mapper: (error: unknown) => unknown): Flux<T> {\n return this.onErrorResume(error => Flux.error(mapper(error)));\n};\n\nFlux.prototype.retry = function retry<T>(this: Flux<T>, maxRetries = Number.POSITIVE_INFINITY): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let attempt = 0;\n while (!signal.aborted) {\n try {\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n return;\n } catch (error) {\n if (attempt >= maxRetries) {\n throw error;\n }\n attempt += 1;\n }\n }\n });\n};\n\nFlux.prototype.repeat = function repeat<T>(this: Flux<T>, repeatCount = Number.POSITIVE_INFINITY): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let repeated = 0;\n do {\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n repeated += 1;\n } while (!signal.aborted && repeated <= repeatCount);\n });\n};\n"],"mappings":";;;;;;AA2BA,KAAK,UAAU,gBAAgB,SAAS,cAEpC,UACW;CACX,MAAM,SAAS;CACf,OAAO,IAAI,KAAK,iBAAiB,QAAQ,SAAS;EAC9C,IAAI;GACA,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GACpD,MAAM;EAEd,SAAS,OAAO;GACZ,WAAW,MAAM,SAAS,KAAK,KAAK,SAAS,KAAK,CAAC,CAAC,CAAC,QAAQ,QAAQ,OAAO,GACxE,MAAM;EAEd;CACJ,CAAC;AACL;AAEA,KAAK,UAAU,gBAAgB,SAAS,cAAgC,eAA2B;CAC/F,OAAO,KAAK,oBAAoB,KAAK,KAAK,aAAa,CAAC;AAC5D;AAEA,KAAK,UAAU,aAAa,SAAS,WAA6B,QAA8C;CAC5G,OAAO,KAAK,eAAc,UAAS,KAAK,MAAM,OAAO,KAAK,CAAC,CAAC;AAChE;AAEA,KAAK,UAAU,QAAQ,SAAS,MAAwB,aAAa,OAAO,mBAA4B;CACpG,MAAM,SAAS;CACf,OAAO,IAAI,KAAK,iBAAiB,QAAQ,SAAS;EAC9C,IAAI,UAAU;EACd,OAAO,CAAC,OAAO,SACX,IAAI;GACA,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GACpD,MAAM;GAEV;EACJ,SAAS,OAAO;GACZ,IAAI,WAAW,YACX,MAAM;GAEV,WAAW;EACf;CAER,CAAC;AACL;AAEA,KAAK,UAAU,SAAS,SAAS,OAAyB,cAAc,OAAO,mBAA4B;CACvG,MAAM,SAAS;CACf,OAAO,IAAI,KAAK,iBAAiB,QAAQ,SAAS;EAC9C,IAAI,WAAW;EACf,GAAG;GACC,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GACpD,MAAM;GAEV,YAAY;EAChB,SAAS,CAAC,OAAO,WAAW,YAAY;CAC5C,CAAC;AACL"}
@@ -0,0 +1,19 @@
1
+ import type { PublisherInput } from "../types.js";
2
+ declare module "../flux.js" {
3
+ /** Flattening and source-combining operators added to Flux. */
4
+ interface Flux<T> {
5
+ /** Maps each value to a publisher and merges inner publishers concurrently. */
6
+ flatMap<R>(mapper: (value: T) => PublisherInput<R>, concurrency?: number): Flux<R>;
7
+ /** Maps each value to a publisher and subscribes to inner publishers one at a time. */
8
+ concatMap<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;
9
+ /** Maps each value to a publisher and relays only the latest active inner publisher. */
10
+ switchMap<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;
11
+ /** Merges this Flux with additional publishers. */
12
+ mergeWith(...others: readonly PublisherInput<T>[]): Flux<T>;
13
+ /** Concatenates this Flux with additional publishers in order. */
14
+ concatWith(...others: readonly PublisherInput<T>[]): Flux<T>;
15
+ /** Prepends literal values before this Flux. */
16
+ startWith(...values: readonly T[]): Flux<T>;
17
+ }
18
+ }
19
+ //# sourceMappingURL=flatten.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.d.ts","sourceRoot":"","sources":["../../../src/publisher/operators/flatten.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,QAAQ,qBAAqB,CAAC;IACjC,+DAA+D;IAC/D,UAAU,IAAI,CAAC,CAAC;QACZ,+EAA+E;QAC/E,OAAO,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAEnF,uFAAuF;QACvF,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE/D,wFAAwF;QACxF,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE/D,mDAAmD;QACnD,SAAS,CAAC,GAAG,MAAM,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE5D,kEAAkE;QAClE,UAAU,CAAC,GAAG,MAAM,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,gDAAgD;QAChD,SAAS,CAAC,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KAC/C;CACJ"}
@@ -0,0 +1,127 @@
1
+ import { AsyncQueue } from "../../internal/async-queue.js";
2
+ import { Flux } from "../flux.js";
3
+ //#region src/publisher/operators/flatten.ts
4
+ Flux.prototype.flatMap = function flatMap(mapper, concurrency = Number.POSITIVE_INFINITY) {
5
+ if (concurrency <= 1) return this.concatMap(mapper);
6
+ const source = this;
7
+ if (concurrency === Number.POSITIVE_INFINITY) return flatMapUnbounded(source, mapper);
8
+ return new Flux((signal, context) => {
9
+ const queue = new AsyncQueue(signal);
10
+ const running = /* @__PURE__ */ new Set();
11
+ let failed = false;
12
+ (async () => {
13
+ try {
14
+ for await (const value of source.iterate(signal, context)) {
15
+ while (running.size >= concurrency && !signal.aborted) await Promise.race(running);
16
+ if (signal.aborted || failed) return;
17
+ let task = Promise.resolve();
18
+ task = (async () => {
19
+ try {
20
+ for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) queue.push(inner);
21
+ } catch (error) {
22
+ failed = true;
23
+ queue.error(error);
24
+ } finally {
25
+ running.delete(task);
26
+ }
27
+ })();
28
+ running.add(task);
29
+ }
30
+ await Promise.all(running);
31
+ if (!failed) queue.complete();
32
+ } catch (error) {
33
+ queue.error(error);
34
+ }
35
+ })();
36
+ return queue;
37
+ });
38
+ };
39
+ /** Flat maps without bounded-concurrency bookkeeping for the default unbounded path. */
40
+ function flatMapUnbounded(source, mapper) {
41
+ return new Flux((signal, context) => {
42
+ const queue = new AsyncQueue(signal);
43
+ const tasks = [];
44
+ let failed = false;
45
+ (async () => {
46
+ try {
47
+ for await (const value of source.iterate(signal, context)) {
48
+ if (signal.aborted || failed) return;
49
+ tasks.push(drainFlatMapInner(mapper(value), signal, context, queue, () => {
50
+ failed = true;
51
+ }));
52
+ }
53
+ await Promise.all(tasks);
54
+ if (!failed) queue.complete();
55
+ } catch (error) {
56
+ queue.error(error);
57
+ }
58
+ })();
59
+ return queue;
60
+ });
61
+ }
62
+ /** Drains one inner flatMap publisher into the shared output queue. */
63
+ async function drainFlatMapInner(input, signal, context, queue, markFailed) {
64
+ try {
65
+ for await (const inner of Flux.from(input).iterate(signal, context)) queue.push(inner);
66
+ } catch (error) {
67
+ markFailed();
68
+ queue.error(error);
69
+ }
70
+ }
71
+ Flux.prototype.concatMap = function concatMap(mapper) {
72
+ const source = this;
73
+ return new Flux(async function* (signal, context) {
74
+ for await (const value of source.iterate(signal, context)) for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) yield inner;
75
+ });
76
+ };
77
+ Flux.prototype.switchMap = function switchMap(mapper) {
78
+ const source = this;
79
+ return new Flux((signal, context) => {
80
+ const queue = new AsyncQueue(signal);
81
+ let active = 0;
82
+ let outerDone = false;
83
+ let failed = false;
84
+ const completeIfDone = () => {
85
+ if (outerDone && active === 0 && !failed) queue.complete();
86
+ };
87
+ (async () => {
88
+ try {
89
+ let version = 0;
90
+ for await (const value of source.iterate(signal, context)) {
91
+ version += 1;
92
+ const current = version;
93
+ active += 1;
94
+ (async () => {
95
+ try {
96
+ for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) if (current === version) queue.push(inner);
97
+ } catch (error) {
98
+ failed = true;
99
+ queue.error(error);
100
+ } finally {
101
+ active -= 1;
102
+ completeIfDone();
103
+ }
104
+ })();
105
+ }
106
+ outerDone = true;
107
+ completeIfDone();
108
+ } catch (error) {
109
+ failed = true;
110
+ queue.error(error);
111
+ }
112
+ })();
113
+ return queue;
114
+ });
115
+ };
116
+ Flux.prototype.mergeWith = function mergeWith(...others) {
117
+ return Flux.merge(this, ...others);
118
+ };
119
+ Flux.prototype.concatWith = function concatWith(...others) {
120
+ return Flux.concat(this, ...others);
121
+ };
122
+ Flux.prototype.startWith = function startWith(...values) {
123
+ return Flux.concat(Flux.just(...values), this);
124
+ };
125
+ //#endregion
126
+
127
+ //# sourceMappingURL=flatten.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flatten.js","names":[],"sources":["../../../src/publisher/operators/flatten.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Flux, Mono and operator implementation modules.\n */\nimport type {Context} from \"@/context/context.js\";\nimport {AsyncQueue} from \"@/internal/async-queue.js\";\nimport {Flux} from \"@/publisher/flux.js\";\nimport type {PublisherInput} from \"@/publisher/types.js\";\n\ndeclare module \"@/publisher/flux.js\" {\n /** Flattening and source-combining operators added to Flux. */\n interface Flux<T> {\n /** Maps each value to a publisher and merges inner publishers concurrently. */\n flatMap<R>(mapper: (value: T) => PublisherInput<R>, concurrency?: number): Flux<R>;\n\n /** Maps each value to a publisher and subscribes to inner publishers one at a time. */\n concatMap<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;\n\n /** Maps each value to a publisher and relays only the latest active inner publisher. */\n switchMap<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;\n\n /** Merges this Flux with additional publishers. */\n mergeWith(...others: readonly PublisherInput<T>[]): Flux<T>;\n\n /** Concatenates this Flux with additional publishers in order. */\n concatWith(...others: readonly PublisherInput<T>[]): Flux<T>;\n\n /** Prepends literal values before this Flux. */\n startWith(...values: readonly T[]): Flux<T>;\n }\n}\n\nFlux.prototype.flatMap = function flatMap<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>,\n concurrency = Number.POSITIVE_INFINITY\n): Flux<R> {\n if (concurrency <= 1) {\n return this.concatMap(mapper);\n }\n const source = this;\n if (concurrency === Number.POSITIVE_INFINITY) {\n return flatMapUnbounded(source, mapper);\n }\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<R>(signal);\n const running = new Set<Promise<void>>();\n let failed = false;\n void (async () => {\n try {\n for await (const value of source.iterate(signal, context)) {\n while (running.size >= concurrency && !signal.aborted) {\n await Promise.race(running);\n }\n if (signal.aborted || failed) {\n return;\n }\n let task: Promise<void> = Promise.resolve();\n task = (async () => {\n try {\n for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) {\n queue.push(inner);\n }\n } catch (error) {\n failed = true;\n queue.error(error);\n } finally {\n running.delete(task);\n }\n })();\n running.add(task);\n }\n await Promise.all(running);\n if (!failed) {\n queue.complete();\n }\n } catch (error) {\n queue.error(error);\n }\n })();\n return queue;\n });\n};\n\n/** Flat maps without bounded-concurrency bookkeeping for the default unbounded path. */\nfunction flatMapUnbounded<T, R>(source: Flux<T>, mapper: (value: T) => PublisherInput<R>): Flux<R> {\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<R>(signal);\n const tasks: Array<Promise<void>> = [];\n let failed = false;\n void (async () => {\n try {\n for await (const value of source.iterate(signal, context)) {\n if (signal.aborted || failed) {\n return;\n }\n tasks.push(drainFlatMapInner(mapper(value), signal, context, queue, () => {\n failed = true;\n }));\n }\n await Promise.all(tasks);\n if (!failed) {\n queue.complete();\n }\n } catch (error) {\n queue.error(error);\n }\n })();\n return queue;\n });\n}\n\n/** Drains one inner flatMap publisher into the shared output queue. */\nasync function drainFlatMapInner<R>(\n input: PublisherInput<R>,\n signal: AbortSignal,\n context: Context,\n queue: AsyncQueue<R>,\n markFailed: () => void\n): Promise<void> {\n try {\n for await (const inner of Flux.from(input).iterate(signal, context)) {\n queue.push(inner);\n }\n } catch (error) {\n markFailed();\n queue.error(error);\n }\n}\n\nFlux.prototype.concatMap = function concatMap<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>\n): Flux<R> {\n const source = this;\n return new Flux(async function* (signal, context) {\n for await (const value of source.iterate(signal, context)) {\n for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) {\n yield inner;\n }\n }\n });\n};\n\nFlux.prototype.switchMap = function switchMap<T, R>(\n this: Flux<T>,\n mapper: (value: T) => PublisherInput<R>\n): Flux<R> {\n const source = this;\n return new Flux((signal, context) => {\n const queue = new AsyncQueue<R>(signal);\n let active = 0;\n let outerDone = false;\n let failed = false;\n const completeIfDone = () => {\n if (outerDone && active === 0 && !failed) {\n queue.complete();\n }\n };\n void (async () => {\n try {\n let version = 0;\n for await (const value of source.iterate(signal, context)) {\n version += 1;\n const current = version;\n active += 1;\n void (async () => {\n try {\n for await (const inner of Flux.from(mapper(value)).iterate(signal, context)) {\n if (current === version) {\n queue.push(inner);\n }\n }\n } catch (error) {\n failed = true;\n queue.error(error);\n } finally {\n active -= 1;\n completeIfDone();\n }\n })();\n }\n outerDone = true;\n completeIfDone();\n } catch (error) {\n failed = true;\n queue.error(error);\n }\n })();\n return queue;\n });\n};\n\nFlux.prototype.mergeWith = function mergeWith<T>(this: Flux<T>, ...others: readonly PublisherInput<T>[]): Flux<T> {\n return Flux.merge(this, ...others);\n};\n\nFlux.prototype.concatWith = function concatWith<T>(this: Flux<T>, ...others: readonly PublisherInput<T>[]): Flux<T> {\n return Flux.concat(this, ...others);\n};\n\nFlux.prototype.startWith = function startWith<T>(this: Flux<T>, ...values: readonly T[]): Flux<T> {\n return Flux.concat(Flux.just(...values), this);\n};\n"],"mappings":";;;AAgCA,KAAK,UAAU,UAAU,SAAS,QAE9B,QACA,cAAc,OAAO,mBACd;CACP,IAAI,eAAe,GACf,OAAO,KAAK,UAAU,MAAM;CAEhC,MAAM,SAAS;CACf,IAAI,gBAAgB,OAAO,mBACvB,OAAO,iBAAiB,QAAQ,MAAM;CAE1C,OAAO,IAAI,MAAM,QAAQ,YAAY;EACjC,MAAM,QAAQ,IAAI,WAAc,MAAM;EACtC,MAAM,0BAAU,IAAI,IAAmB;EACvC,IAAI,SAAS;EACb,CAAM,YAAY;GACd,IAAI;IACA,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GAAG;KACvD,OAAO,QAAQ,QAAQ,eAAe,CAAC,OAAO,SAC1C,MAAM,QAAQ,KAAK,OAAO;KAE9B,IAAI,OAAO,WAAW,QAClB;KAEJ,IAAI,OAAsB,QAAQ,QAAQ;KAC1C,QAAQ,YAAY;MAChB,IAAI;OACA,WAAW,MAAM,SAAS,KAAK,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,QAAQ,OAAO,GACtE,MAAM,KAAK,KAAK;MAExB,SAAS,OAAO;OACZ,SAAS;OACT,MAAM,MAAM,KAAK;MACrB,UAAU;OACN,QAAQ,OAAO,IAAI;MACvB;KACJ,EAAA,CAAG;KACH,QAAQ,IAAI,IAAI;IACpB;IACA,MAAM,QAAQ,IAAI,OAAO;IACzB,I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EACjC,MAAM,QAAQ,IAAI,WAAc,MAAM;EACtC,IAAI,SAAS;EACb,IAAI,YAAY;EAChB,IAAI,SAAS;EACb,MAAM,uBAAuB;GACzB,IAAI,aAAa,WAAW,KAAK,CAAC,QAC9B,MAAM,SAAS;EAEvB;EACA,CAAM,YAAY;GACd,IAAI;IACA,IAAI,UAAU;IACd,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GAAG;KACvD,WAAW;KACX,MAAM,UAAU;KAChB,UAAU;KACV,CAAM,YAAY;MACd,IAAI;OACA,WAAW,MAAM,SAAS,KAAK,KAAK,OAAO,KAAK,CAAC,CAAC,CAAC,QAAQ,QAAQ,OAAO,GACtE,IAAI,YAAY,SACZ,MAAM,KAAK,KAAK;MAG5B,SAAS,OAAO;OACZ,SAAS;OACT,MAAM,MAAM,KAAK;MACrB,UAAU;OACN,UAAU;OACV,eAAe;MACnB;KACJ,EAAA,CAAG;IACP;IACA,YAAY;IACZ,eAAe;GACnB,SAAS,OAAO;IACZ,SAAS;IACT,MAAM,MAAM,KAAK;GACrB;EACJ,EAAA,CAAG;EACH,OAAO;CACX,CAAC;AACL;AAEA,KAAK,UAAU,YAAY,SAAS,UAA4B,GAAG,QAA+C;CAC9G,OAAO,KAAK,MAAM,MAAM,GAAG,MAAM;AACrC;AAEA,KAAK,UAAU,aAAa,SAAS,WAA6B,GAAG,QAA+C;CAChH,OAAO,KAAK,OAAO,MAAM,GAAG,MAAM;AACtC;AAEA,KAAK,UAAU,YAAY,SAAS,UAA4B,GAAG,QAA+B;CAC9F,OAAO,KAAK,OAAO,KAAK,KAAK,GAAG,MAAM,GAAG,IAAI;AACjD"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @packageDocumentation
3
+ * Reactor lifecycle, context, logging and browser backpressure compatibility operators.
4
+ */
5
+ import { Context } from "../../context/context.js";
6
+ import { ContextView } from "../../context/context-view.js";
7
+ import type { PublisherInput } from "../types.js";
8
+ import type { DurationInput, Scheduler } from "../../schedulers/types.js";
9
+ import { Signal } from "../../signal/signal.js";
10
+ import type { Subscription } from "../../subscription/subscription.js";
11
+ /** Listener shape accepted by the lightweight `tap` compatibility operator. */
12
+ export interface FluxTapListener<T> {
13
+ /** Invoked for each next value. */
14
+ onNext?(value: T): void;
15
+ /** Invoked when the sequence fails. */
16
+ onError?(error: unknown): void;
17
+ /** Invoked when the sequence completes. */
18
+ onComplete?(): void;
19
+ /** Invoked when the sequence is cancelled. */
20
+ onCancel?(): void;
21
+ /** Invoked for materialized next, error and complete signals. */
22
+ onSignal?(signal: Signal<T>): void;
23
+ }
24
+ declare module "../flux.js" {
25
+ /** Lifecycle, context and browser backpressure compatibility operators added to Flux. */
26
+ interface Flux<T> {
27
+ /** Replays the collected source values to later subscribers. */
28
+ cache(ttl?: DurationInput, scheduler?: Scheduler): Flux<T>;
29
+ /** Schedules cancellation on the provided scheduler when supported by the source. */
30
+ cancelOn(scheduler: Scheduler): Flux<T>;
31
+ /** Adds an assembly checkpoint marker. Browser implementation keeps the source unchanged. */
32
+ checkpoint(description?: string, forceStackTrace?: boolean): Flux<T>;
33
+ /** Captures ambient context when an integration provides it. Browser implementation keeps the source unchanged. */
34
+ contextCapture(): Flux<T>;
35
+ /** Writes subscriber context for upstream operators. */
36
+ contextWrite(context: ContextView | Context | ((context: Context) => Context)): Flux<T>;
37
+ /** Delays subscribing to the source. */
38
+ delaySequence(delay: DurationInput, scheduler?: Scheduler): Flux<T>;
39
+ /** Delays subscribing to the source by time or until another publisher signals. */
40
+ delaySubscription(delay: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Flux<T>;
41
+ /** Delays each value until the trigger publisher derived from that value completes. */
42
+ delayUntil(triggerProvider: (value: T) => PublisherInput<unknown>): Flux<T>;
43
+ /** Invokes a callback after successful or failed termination. */
44
+ doAfterTerminate(callback: () => void): Flux<T>;
45
+ /** Invokes a callback before source iteration starts. */
46
+ doFirst(callback: () => void): Flux<T>;
47
+ /** Invokes a callback when the subscription is cancelled. */
48
+ doOnCancel(callback: () => void): Flux<T>;
49
+ /** Registers a discard hook. Browser implementation keeps values unchanged. */
50
+ doOnDiscard<R>(type: new (...args: never[]) => R, callback: (value: R) => void): Flux<T>;
51
+ /** Invokes a callback for every materialized source signal. */
52
+ doOnEach(callback: (signal: Signal<T>) => void): Flux<T>;
53
+ /** Invokes a callback when unbounded demand is requested by the async bridge. */
54
+ doOnRequest(callback: (request: number) => void): Flux<T>;
55
+ /** Invokes a callback with a synthetic subscription before source iteration starts. */
56
+ doOnSubscribe(callback: (subscription: Subscription) => void): Flux<T>;
57
+ /** Invokes a callback before successful or failed termination. */
58
+ doOnTerminate(callback: () => void): Flux<T>;
59
+ /** Keeps request batching metadata. Browser async iteration returns this source unchanged. */
60
+ limitRate(highTide: number, lowTide?: number): Flux<T>;
61
+ /** Limits the total number of requested values. */
62
+ limitRequest(n: number): Flux<T>;
63
+ /** Logs source signals to the console. */
64
+ log(category?: string): Flux<T>;
65
+ /** Keeps metrics compatibility metadata. Browser implementation returns this source unchanged. */
66
+ metrics(): Flux<T>;
67
+ /** Keeps a human-readable sequence name. Browser implementation returns this source unchanged. */
68
+ name(name: string): Flux<T>;
69
+ /** Buffers on backpressure. Browser async iteration already buffers by pull demand. */
70
+ onBackpressureBuffer(...args: unknown[]): Flux<T>;
71
+ /** Drops on backpressure. Browser async iteration keeps pull demand and returns this source unchanged. */
72
+ onBackpressureDrop(callback?: (value: T) => void): Flux<T>;
73
+ /** Fails on backpressure. Browser async iteration keeps pull demand and returns this source unchanged. */
74
+ onBackpressureError(): Flux<T>;
75
+ /** Keeps only the latest value on backpressure. Browser async iteration returns this source unchanged. */
76
+ onBackpressureLatest(): Flux<T>;
77
+ /** Completes instead of failing when the optional predicate accepts the error. */
78
+ onErrorComplete(predicate?: (error: unknown) => boolean): Flux<T>;
79
+ /** Continues with completion after invoking an error continuation callback. */
80
+ onErrorContinue(callback: (error: unknown, value: T | undefined) => void): Flux<T>;
81
+ /** Stops error continuation mode. Browser implementation returns this source unchanged. */
82
+ onErrorStop(): Flux<T>;
83
+ /** Drops terminal-reference retention hints. Browser implementation returns this source unchanged. */
84
+ onTerminateDetach(): Flux<T>;
85
+ /** Transforms a shared source or returns a shared source view. */
86
+ publish<R = T>(transformer?: (source: Flux<T>) => PublisherInput<R>): Flux<R>;
87
+ /** Returns a Mono with the next value from this source. */
88
+ publishNext(): import("../mono.js").Mono<T>;
89
+ /** Returns a replaying view of this source. */
90
+ replay(...args: unknown[]): Flux<T>;
91
+ /** Returns a shared browser view of this source. */
92
+ share(): Flux<T>;
93
+ /** Returns a Mono with the next value from a shared source. */
94
+ shareNext(): import("../mono.js").Mono<T>;
95
+ /** Stores a metadata tag. Browser implementation returns this source unchanged. */
96
+ tag(key: string, value: string): Flux<T>;
97
+ /** Installs listener callbacks for values, terminal signals, and cancellation. */
98
+ tap(listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Flux<T>;
99
+ /** Returns an async iterator stream view of this Flux. */
100
+ toStream(): AsyncIterable<T>;
101
+ }
102
+ }
103
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/publisher/operators/lifecycle.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAGtD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AAEzD,OAAO,KAAK,EAAC,aAAa,EAAE,SAAS,EAAC,MAAM,uBAAuB,CAAC;AACpE,OAAO,EAAC,MAAM,EAAC,MAAM,oBAAoB,CAAC;AAC1C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,gCAAgC,CAAC;AAEjE,+EAA+E;AAC/E,MAAM,WAAW,eAAe,CAAC,CAAC;IAC9B,mCAAmC;IACnC,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC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