reactor-core-ts 2.1.5 → 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.
- package/README.md +927 -651
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/defineProperty.js +12 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPrimitive.js +14 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/toPropertyKey.js +9 -0
- package/dist/_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/typeof.js +11 -0
- package/dist/context/context-view.d.ts +31 -0
- package/dist/context/context-view.d.ts.map +1 -0
- package/dist/context/context-view.js +58 -0
- package/dist/context/context-view.js.map +1 -0
- package/dist/context/context.d.ts +46 -0
- package/dist/context/context.d.ts.map +1 -0
- package/dist/context/context.js +125 -0
- package/dist/context/context.js.map +1 -0
- package/dist/context/types.d.ts +7 -0
- package/dist/context/types.d.ts.map +1 -0
- package/dist/core/boolean-disposable.d.ts +19 -0
- package/dist/core/boolean-disposable.d.ts.map +1 -0
- package/dist/core/boolean-disposable.js +37 -0
- package/dist/core/boolean-disposable.js.map +1 -0
- package/dist/core/composite-disposable.d.ts +21 -0
- package/dist/core/composite-disposable.d.ts.map +1 -0
- package/dist/core/composite-disposable.js +64 -0
- package/dist/core/composite-disposable.js.map +1 -0
- package/dist/core/demand.d.ts +9 -0
- package/dist/core/demand.d.ts.map +1 -0
- package/dist/core/demand.js +21 -0
- package/dist/core/demand.js.map +1 -0
- package/dist/core/disposables.d.ts +12 -0
- package/dist/core/disposables.d.ts.map +1 -0
- package/dist/core/disposables.js +37 -0
- package/dist/core/disposables.js.map +1 -0
- package/dist/core/teardown.d.ts +4 -0
- package/dist/core/teardown.d.ts.map +1 -0
- package/dist/core/types.d.ts +14 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/errors/classes.d.ts +37 -0
- package/dist/errors/classes.d.ts.map +1 -0
- package/dist/errors/classes.js +53 -0
- package/dist/errors/classes.js.map +1 -0
- package/dist/errors/exceptions.d.ts +15 -0
- package/dist/errors/exceptions.d.ts.map +1 -0
- package/dist/errors/helpers.d.ts +9 -0
- package/dist/errors/helpers.d.ts.map +1 -0
- package/dist/errors/helpers.js +18 -0
- package/dist/errors/helpers.js.map +1 -0
- package/dist/index.d.ts +17 -2534
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -2
- package/dist/internal/abort.d.ts +5 -0
- package/dist/internal/abort.d.ts.map +1 -0
- package/dist/internal/abort.js +36 -0
- package/dist/internal/abort.js.map +1 -0
- package/dist/internal/async-queue.d.ts +48 -0
- package/dist/internal/async-queue.d.ts.map +1 -0
- package/dist/internal/async-queue.js +187 -0
- package/dist/internal/async-queue.js.map +1 -0
- package/dist/internal/iterable-terminal.d.ts +12 -0
- package/dist/internal/iterable-terminal.d.ts.map +1 -0
- package/dist/internal/iterable-terminal.js +49 -0
- package/dist/internal/iterable-terminal.js.map +1 -0
- package/dist/internal/iterable-transform.d.ts +24 -0
- package/dist/internal/iterable-transform.d.ts.map +1 -0
- package/dist/internal/iterable-transform.js +159 -0
- package/dist/internal/iterable-transform.js.map +1 -0
- package/dist/internal/iterable.d.ts +23 -0
- package/dist/internal/iterable.d.ts.map +1 -0
- package/dist/internal/iterable.js +81 -0
- package/dist/internal/iterable.js.map +1 -0
- package/dist/internal/microtask.d.ts +7 -0
- package/dist/internal/microtask.d.ts.map +1 -0
- package/dist/internal/microtask.js +19 -0
- package/dist/internal/microtask.js.map +1 -0
- package/dist/publisher/browser-sources.d.ts +15 -0
- package/dist/publisher/browser-sources.d.ts.map +1 -0
- package/dist/publisher/browser-sources.js +92 -0
- package/dist/publisher/browser-sources.js.map +1 -0
- package/dist/publisher/flux-entrypoint.d.ts +7 -0
- package/dist/publisher/flux-entrypoint.d.ts.map +1 -0
- package/dist/publisher/flux-entrypoint.js +11 -0
- package/dist/publisher/flux-entrypoint.js.map +1 -0
- package/dist/publisher/flux.d.ts +121 -0
- package/dist/publisher/flux.d.ts.map +1 -0
- package/dist/publisher/flux.js +697 -0
- package/dist/publisher/flux.js.map +1 -0
- package/dist/publisher/helpers.d.ts +19 -0
- package/dist/publisher/helpers.d.ts.map +1 -0
- package/dist/publisher/helpers.js +84 -0
- package/dist/publisher/helpers.js.map +1 -0
- package/dist/publisher/mono-entrypoint.d.ts +7 -0
- package/dist/publisher/mono-entrypoint.d.ts.map +1 -0
- package/dist/publisher/mono-entrypoint.js +11 -0
- package/dist/publisher/mono-entrypoint.js.map +1 -0
- package/dist/publisher/mono.d.ts +72 -0
- package/dist/publisher/mono.d.ts.map +1 -0
- package/dist/publisher/mono.js +373 -0
- package/dist/publisher/mono.js.map +1 -0
- package/dist/publisher/operators/aggregate.d.ts +35 -0
- package/dist/publisher/operators/aggregate.d.ts.map +1 -0
- package/dist/publisher/operators/aggregate.js +217 -0
- package/dist/publisher/operators/aggregate.js.map +1 -0
- package/dist/publisher/operators/compat/flux.d.ts +56 -0
- package/dist/publisher/operators/compat/flux.d.ts.map +1 -0
- package/dist/publisher/operators/compat/flux.js +156 -0
- package/dist/publisher/operators/compat/flux.js.map +1 -0
- package/dist/publisher/operators/compat/mono.d.ts +82 -0
- package/dist/publisher/operators/compat/mono.d.ts.map +1 -0
- package/dist/publisher/operators/compat/mono.js +125 -0
- package/dist/publisher/operators/compat/mono.js.map +1 -0
- package/dist/publisher/operators/coordination.d.ts +82 -0
- package/dist/publisher/operators/coordination.d.ts.map +1 -0
- package/dist/publisher/operators/coordination.js +345 -0
- package/dist/publisher/operators/coordination.js.map +1 -0
- package/dist/publisher/operators/error.d.ts +17 -0
- package/dist/publisher/operators/error.d.ts.map +1 -0
- package/dist/publisher/operators/error.js +48 -0
- package/dist/publisher/operators/error.js.map +1 -0
- package/dist/publisher/operators/flatten.d.ts +19 -0
- package/dist/publisher/operators/flatten.d.ts.map +1 -0
- package/dist/publisher/operators/flatten.js +127 -0
- package/dist/publisher/operators/flatten.js.map +1 -0
- package/dist/publisher/operators/lifecycle.d.ts +103 -0
- package/dist/publisher/operators/lifecycle.d.ts.map +1 -0
- package/dist/publisher/operators/lifecycle.js +237 -0
- package/dist/publisher/operators/lifecycle.js.map +1 -0
- package/dist/publisher/operators/mono-parity.d.ts +109 -0
- package/dist/publisher/operators/mono-parity.d.ts.map +1 -0
- package/dist/publisher/operators/mono-parity.js +144 -0
- package/dist/publisher/operators/mono-parity.js.map +1 -0
- package/dist/publisher/operators/mono.d.ts +30 -0
- package/dist/publisher/operators/mono.d.ts.map +1 -0
- package/dist/publisher/operators/mono.js +37 -0
- package/dist/publisher/operators/mono.js.map +1 -0
- package/dist/publisher/operators/register.d.ts +20 -0
- package/dist/publisher/operators/register.d.ts.map +1 -0
- package/dist/publisher/operators/register.js +23 -0
- package/dist/publisher/operators/register.js.map +1 -0
- package/dist/publisher/operators/selection.d.ts +25 -0
- package/dist/publisher/operators/selection.d.ts.map +1 -0
- package/dist/publisher/operators/selection.js +108 -0
- package/dist/publisher/operators/selection.js.map +1 -0
- package/dist/publisher/operators/side-effect.d.ts +15 -0
- package/dist/publisher/operators/side-effect.d.ts.map +1 -0
- package/dist/publisher/operators/side-effect.js +56 -0
- package/dist/publisher/operators/side-effect.js.map +1 -0
- package/dist/publisher/operators/terminal.d.ts +16 -0
- package/dist/publisher/operators/terminal.d.ts.map +1 -0
- package/dist/publisher/operators/terminal.js +47 -0
- package/dist/publisher/operators/terminal.js.map +1 -0
- package/dist/publisher/operators/time.d.ts +20 -0
- package/dist/publisher/operators/time.d.ts.map +1 -0
- package/dist/publisher/operators/time.js +92 -0
- package/dist/publisher/operators/time.js.map +1 -0
- package/dist/publisher/operators/transform.d.ts +31 -0
- package/dist/publisher/operators/transform.d.ts.map +1 -0
- package/dist/publisher/operators/transform.js +74 -0
- package/dist/publisher/operators/transform.js.map +1 -0
- package/dist/publisher/operators/windowing.d.ts +28 -0
- package/dist/publisher/operators/windowing.d.ts.map +1 -0
- package/dist/publisher/operators/windowing.js +148 -0
- package/dist/publisher/operators/windowing.js.map +1 -0
- package/dist/publisher/publisher.d.ts +11 -0
- package/dist/publisher/publisher.d.ts.map +1 -0
- package/dist/publisher/types.d.ts +51 -0
- package/dist/publisher/types.d.ts.map +1 -0
- package/dist/schedulers/animation-frame-scheduler.d.ts +11 -0
- package/dist/schedulers/animation-frame-scheduler.d.ts.map +1 -0
- package/dist/schedulers/animation-frame-scheduler.js +30 -0
- package/dist/schedulers/animation-frame-scheduler.js.map +1 -0
- package/dist/schedulers/base-scheduler.d.ts +28 -0
- package/dist/schedulers/base-scheduler.d.ts.map +1 -0
- package/dist/schedulers/base-scheduler.js +77 -0
- package/dist/schedulers/base-scheduler.js.map +1 -0
- package/dist/schedulers/basic-worker.d.ts +22 -0
- package/dist/schedulers/basic-worker.d.ts.map +1 -0
- package/dist/schedulers/basic-worker.js +71 -0
- package/dist/schedulers/basic-worker.js.map +1 -0
- package/dist/schedulers/delay-scheduler.d.ts +12 -0
- package/dist/schedulers/delay-scheduler.d.ts.map +1 -0
- package/dist/schedulers/delay-scheduler.js +17 -0
- package/dist/schedulers/delay-scheduler.js.map +1 -0
- package/dist/schedulers/disposed.d.ts +4 -0
- package/dist/schedulers/disposed.d.ts.map +1 -0
- package/dist/schedulers/disposed.js +14 -0
- package/dist/schedulers/disposed.js.map +1 -0
- package/dist/schedulers/duration.d.ts +8 -0
- package/dist/schedulers/duration.d.ts.map +1 -0
- package/dist/schedulers/duration.js +11 -0
- package/dist/schedulers/duration.js.map +1 -0
- package/dist/schedulers/executor-scheduler.d.ts +13 -0
- package/dist/schedulers/executor-scheduler.d.ts.map +1 -0
- package/dist/schedulers/executor-scheduler.js +43 -0
- package/dist/schedulers/executor-scheduler.js.map +1 -0
- package/dist/schedulers/immediate-scheduler.d.ts +15 -0
- package/dist/schedulers/immediate-scheduler.d.ts.map +1 -0
- package/dist/schedulers/immediate-scheduler.js +24 -0
- package/dist/schedulers/immediate-scheduler.js.map +1 -0
- package/dist/schedulers/index.d.ts +7 -0
- package/dist/schedulers/index.d.ts.map +1 -0
- package/dist/schedulers/index.js +2 -0
- package/dist/schedulers/interval-scheduler.d.ts +12 -0
- package/dist/schedulers/interval-scheduler.d.ts.map +1 -0
- package/dist/schedulers/interval-scheduler.js +17 -0
- package/dist/schedulers/interval-scheduler.js.map +1 -0
- package/dist/schedulers/macro-scheduler.d.ts +19 -0
- package/dist/schedulers/macro-scheduler.d.ts.map +1 -0
- package/dist/schedulers/macro-scheduler.js +30 -0
- package/dist/schedulers/macro-scheduler.js.map +1 -0
- package/dist/schedulers/microtask-scheduler.d.ts +11 -0
- package/dist/schedulers/microtask-scheduler.d.ts.map +1 -0
- package/dist/schedulers/microtask-scheduler.js +34 -0
- package/dist/schedulers/microtask-scheduler.js.map +1 -0
- package/dist/schedulers/schedulers.d.ts +39 -0
- package/dist/schedulers/schedulers.d.ts.map +1 -0
- package/dist/schedulers/schedulers.js +83 -0
- package/dist/schedulers/schedulers.js.map +1 -0
- package/dist/schedulers/timeout-scheduler.d.ts +11 -0
- package/dist/schedulers/timeout-scheduler.d.ts.map +1 -0
- package/dist/schedulers/types.d.ts +35 -0
- package/dist/schedulers/types.d.ts.map +1 -0
- package/dist/signal/signal-type.d.ts +26 -0
- package/dist/signal/signal-type.d.ts.map +1 -0
- package/dist/signal/signal-type.js +31 -0
- package/dist/signal/signal-type.js.map +1 -0
- package/dist/signal/signal.d.ts +33 -0
- package/dist/signal/signal.d.ts.map +1 -0
- package/dist/signal/signal.js +70 -0
- package/dist/signal/signal.js.map +1 -0
- package/dist/sinks/index.d.ts +7 -0
- package/dist/sinks/index.d.ts.map +1 -0
- package/dist/sinks/index.js +2 -0
- package/dist/sinks/many.d.ts +66 -0
- package/dist/sinks/many.d.ts.map +1 -0
- package/dist/sinks/many.js +193 -0
- package/dist/sinks/many.js.map +1 -0
- package/dist/sinks/one.d.ts +41 -0
- package/dist/sinks/one.d.ts.map +1 -0
- package/dist/sinks/one.js +144 -0
- package/dist/sinks/one.js.map +1 -0
- package/dist/sinks/specs.d.ts +25 -0
- package/dist/sinks/specs.d.ts.map +1 -0
- package/dist/sinks/specs.js +126 -0
- package/dist/sinks/specs.js.map +1 -0
- package/dist/sinks/subscribers.d.ts +16 -0
- package/dist/sinks/subscribers.d.ts.map +1 -0
- package/dist/sinks/subscribers.js +32 -0
- package/dist/sinks/subscribers.js.map +1 -0
- package/dist/sinks/types.d.ts +137 -0
- package/dist/sinks/types.d.ts.map +1 -0
- package/dist/sinks/types.js +58 -0
- package/dist/sinks/types.js.map +1 -0
- package/dist/subscription/core-subscriber.d.ts +12 -0
- package/dist/subscription/core-subscriber.d.ts.map +1 -0
- package/dist/subscription/iterable-subscription.d.ts +64 -0
- package/dist/subscription/iterable-subscription.d.ts.map +1 -0
- package/dist/subscription/iterable-subscription.js +281 -0
- package/dist/subscription/iterable-subscription.js.map +1 -0
- package/dist/subscription/reactive-streams.d.ts +8 -0
- package/dist/subscription/reactive-streams.d.ts.map +1 -0
- package/dist/subscription/reactive-streams.js +0 -0
- package/dist/subscription/subscriber.d.ts +17 -0
- package/dist/subscription/subscriber.d.ts.map +1 -0
- package/dist/subscription/subscription.d.ts +12 -0
- package/dist/subscription/subscription.d.ts.map +1 -0
- package/package.json +99 -33
- package/LICENSE.md +0 -56
- package/dist/index.d.mts +0 -2535
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { Schedulers } from "../../schedulers/schedulers.js";
|
|
2
|
+
import { scheduleDelay } from "../helpers.js";
|
|
3
|
+
import { Flux } from "../flux.js";
|
|
4
|
+
import { Signal } from "../../signal/signal.js";
|
|
5
|
+
//#region src/publisher/operators/lifecycle.ts
|
|
6
|
+
Flux.prototype.cache = function cache(_ttl, _scheduler) {
|
|
7
|
+
const source = this;
|
|
8
|
+
let values;
|
|
9
|
+
let failure;
|
|
10
|
+
let loaded;
|
|
11
|
+
return new Flux(async function* (signal, context) {
|
|
12
|
+
loaded ?? (loaded = (async () => {
|
|
13
|
+
const nextValues = [];
|
|
14
|
+
try {
|
|
15
|
+
for await (const value of source.iterate(signal, context)) nextValues.push(value);
|
|
16
|
+
values = nextValues;
|
|
17
|
+
} catch (error) {
|
|
18
|
+
failure = error;
|
|
19
|
+
}
|
|
20
|
+
})());
|
|
21
|
+
await loaded;
|
|
22
|
+
if (failure !== void 0) throw failure;
|
|
23
|
+
yield* values ?? [];
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
Flux.prototype.cancelOn = function cancelOn(_scheduler) {
|
|
27
|
+
return this;
|
|
28
|
+
};
|
|
29
|
+
Flux.prototype.checkpoint = function checkpoint(_description, _forceStackTrace) {
|
|
30
|
+
return this;
|
|
31
|
+
};
|
|
32
|
+
Flux.prototype.contextCapture = function contextCapture() {
|
|
33
|
+
return this;
|
|
34
|
+
};
|
|
35
|
+
Flux.prototype.contextWrite = function contextWrite(contextUpdate) {
|
|
36
|
+
const source = this;
|
|
37
|
+
return new Flux((signal, context) => {
|
|
38
|
+
const nextContext = typeof contextUpdate === "function" ? contextUpdate(context) : context.putAll(contextUpdate);
|
|
39
|
+
return source.iterate(signal, nextContext);
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
Flux.prototype.delaySequence = function delaySequence(delay, scheduler) {
|
|
43
|
+
return this.delaySubscription(delay, scheduler);
|
|
44
|
+
};
|
|
45
|
+
Flux.prototype.delaySubscription = function delaySubscription(delay, scheduler) {
|
|
46
|
+
const source = this;
|
|
47
|
+
return new Flux(async function* (signal, context) {
|
|
48
|
+
if (isDuration(delay)) await scheduleDelay(scheduler ?? Schedulers.timeout(), delay, signal);
|
|
49
|
+
else await drain(delay, signal, context);
|
|
50
|
+
for await (const value of source.iterate(signal, context)) yield value;
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
Flux.prototype.delayUntil = function delayUntil(triggerProvider) {
|
|
54
|
+
const source = this;
|
|
55
|
+
return new Flux(async function* (signal, context) {
|
|
56
|
+
for await (const value of source.iterate(signal, context)) {
|
|
57
|
+
await drain(triggerProvider(value), signal, context);
|
|
58
|
+
yield value;
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
Flux.prototype.doAfterTerminate = function doAfterTerminate(callback) {
|
|
63
|
+
const source = this;
|
|
64
|
+
return new Flux(async function* (signal, context) {
|
|
65
|
+
let terminated = false;
|
|
66
|
+
try {
|
|
67
|
+
for await (const value of source.iterate(signal, context)) yield value;
|
|
68
|
+
terminated = true;
|
|
69
|
+
} finally {
|
|
70
|
+
if (terminated) callback();
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
Flux.prototype.doFirst = function doFirst(callback) {
|
|
75
|
+
const source = this;
|
|
76
|
+
return new Flux((signal, context) => {
|
|
77
|
+
callback();
|
|
78
|
+
return source.iterate(signal, context);
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
Flux.prototype.doOnCancel = function doOnCancel(callback) {
|
|
82
|
+
const source = this;
|
|
83
|
+
return new Flux((signal, context) => {
|
|
84
|
+
signal.addEventListener("abort", callback, { once: true });
|
|
85
|
+
return source.iterate(signal, context);
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
Flux.prototype.doOnDiscard = function doOnDiscard(_type, _callback) {
|
|
89
|
+
return this;
|
|
90
|
+
};
|
|
91
|
+
Flux.prototype.doOnEach = function doOnEach(callback) {
|
|
92
|
+
const source = this;
|
|
93
|
+
return new Flux(async function* (signal, context) {
|
|
94
|
+
try {
|
|
95
|
+
for await (const value of source.iterate(signal, context)) {
|
|
96
|
+
callback(Signal.next(value));
|
|
97
|
+
yield value;
|
|
98
|
+
}
|
|
99
|
+
callback(Signal.complete());
|
|
100
|
+
} catch (error) {
|
|
101
|
+
callback(Signal.error(error));
|
|
102
|
+
throw error;
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
};
|
|
106
|
+
Flux.prototype.doOnRequest = function doOnRequest(callback) {
|
|
107
|
+
return this.doFirst(() => callback(Number.POSITIVE_INFINITY));
|
|
108
|
+
};
|
|
109
|
+
Flux.prototype.doOnSubscribe = function doOnSubscribe(callback) {
|
|
110
|
+
return this.doFirst(() => callback(noopSubscription()));
|
|
111
|
+
};
|
|
112
|
+
Flux.prototype.doOnTerminate = function doOnTerminate(callback) {
|
|
113
|
+
const source = this;
|
|
114
|
+
return new Flux(async function* (signal, context) {
|
|
115
|
+
try {
|
|
116
|
+
for await (const value of source.iterate(signal, context)) yield value;
|
|
117
|
+
callback();
|
|
118
|
+
} catch (error) {
|
|
119
|
+
callback();
|
|
120
|
+
throw error;
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
Flux.prototype.limitRate = function limitRate(_highTide, _lowTide) {
|
|
125
|
+
return this;
|
|
126
|
+
};
|
|
127
|
+
Flux.prototype.limitRequest = function limitRequest(n) {
|
|
128
|
+
return this.take(n);
|
|
129
|
+
};
|
|
130
|
+
Flux.prototype.log = function log(category = "Flux") {
|
|
131
|
+
return this.doOnEach((signal) => console.debug(category, signal.type, signal.value ?? signal.error));
|
|
132
|
+
};
|
|
133
|
+
Flux.prototype.metrics = function metrics() {
|
|
134
|
+
return this;
|
|
135
|
+
};
|
|
136
|
+
Flux.prototype.name = function name(_name) {
|
|
137
|
+
return this;
|
|
138
|
+
};
|
|
139
|
+
Flux.prototype.onBackpressureBuffer = function onBackpressureBuffer(..._args) {
|
|
140
|
+
return this;
|
|
141
|
+
};
|
|
142
|
+
Flux.prototype.onBackpressureDrop = function onBackpressureDrop(_callback) {
|
|
143
|
+
return this;
|
|
144
|
+
};
|
|
145
|
+
Flux.prototype.onBackpressureError = function onBackpressureError() {
|
|
146
|
+
return this;
|
|
147
|
+
};
|
|
148
|
+
Flux.prototype.onBackpressureLatest = function onBackpressureLatest() {
|
|
149
|
+
return this;
|
|
150
|
+
};
|
|
151
|
+
Flux.prototype.onErrorComplete = function onErrorComplete(predicate = () => true) {
|
|
152
|
+
const source = this;
|
|
153
|
+
return new Flux(async function* (signal, context) {
|
|
154
|
+
try {
|
|
155
|
+
for await (const value of source.iterate(signal, context)) yield value;
|
|
156
|
+
} catch (error) {
|
|
157
|
+
if (!predicate(error)) throw error;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
Flux.prototype.onErrorContinue = function onErrorContinue(callback) {
|
|
162
|
+
return this.onErrorResume((error) => {
|
|
163
|
+
callback(error, void 0);
|
|
164
|
+
return Flux.empty();
|
|
165
|
+
});
|
|
166
|
+
};
|
|
167
|
+
Flux.prototype.onErrorStop = function onErrorStop() {
|
|
168
|
+
return this;
|
|
169
|
+
};
|
|
170
|
+
Flux.prototype.onTerminateDetach = function onTerminateDetach() {
|
|
171
|
+
return this;
|
|
172
|
+
};
|
|
173
|
+
Flux.prototype.publish = function publish(transformer) {
|
|
174
|
+
return transformer ? Flux.from(transformer(this.share())) : this.share();
|
|
175
|
+
};
|
|
176
|
+
Flux.prototype.publishNext = function publishNext() {
|
|
177
|
+
return this.next();
|
|
178
|
+
};
|
|
179
|
+
Flux.prototype.replay = function replay(..._args) {
|
|
180
|
+
return this.cache();
|
|
181
|
+
};
|
|
182
|
+
Flux.prototype.share = function share() {
|
|
183
|
+
return this;
|
|
184
|
+
};
|
|
185
|
+
Flux.prototype.shareNext = function shareNext() {
|
|
186
|
+
return this.next();
|
|
187
|
+
};
|
|
188
|
+
Flux.prototype.tag = function tag(_key, _value) {
|
|
189
|
+
return this;
|
|
190
|
+
};
|
|
191
|
+
Flux.prototype.tap = function tap(listener) {
|
|
192
|
+
const source = this;
|
|
193
|
+
return new Flux(async function* (signal, context) {
|
|
194
|
+
const actual = typeof listener === "function" ? listener() : listener;
|
|
195
|
+
signal.addEventListener("abort", () => actual.onCancel?.(), { once: true });
|
|
196
|
+
try {
|
|
197
|
+
for await (const value of source.iterate(signal, context)) {
|
|
198
|
+
actual.onNext?.(value);
|
|
199
|
+
actual.onSignal?.(Signal.next(value));
|
|
200
|
+
yield value;
|
|
201
|
+
}
|
|
202
|
+
actual.onComplete?.();
|
|
203
|
+
actual.onSignal?.(Signal.complete());
|
|
204
|
+
} catch (error) {
|
|
205
|
+
actual.onError?.(error);
|
|
206
|
+
actual.onSignal?.(Signal.error(error));
|
|
207
|
+
throw error;
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
};
|
|
211
|
+
Flux.prototype.toStream = function toStream() {
|
|
212
|
+
return this;
|
|
213
|
+
};
|
|
214
|
+
/** Returns true when a value can be treated as a duration input. */
|
|
215
|
+
function isDuration(value) {
|
|
216
|
+
return typeof value === "number" || typeof value === "object" && value !== null && !isPublisherLike(value);
|
|
217
|
+
}
|
|
218
|
+
/** Returns true when a value looks like a publisher or iterable source. */
|
|
219
|
+
function isPublisherLike(value) {
|
|
220
|
+
return typeof value.subscribe === "function" || typeof value.then === "function" || typeof value[Symbol.iterator] === "function" || typeof value[Symbol.asyncIterator] === "function";
|
|
221
|
+
}
|
|
222
|
+
/** Consumes a publisher input and ignores all emitted values. */
|
|
223
|
+
async function drain(source, signal, context) {
|
|
224
|
+
for await (const _ of Flux.from(source).iterate(signal, context));
|
|
225
|
+
}
|
|
226
|
+
/** Creates a no-op subscription object for doOnSubscribe callbacks. */
|
|
227
|
+
function noopSubscription() {
|
|
228
|
+
return {
|
|
229
|
+
/** Ignores request accounting for synthetic subscriptions. */
|
|
230
|
+
request() {},
|
|
231
|
+
/** Ignores cancellation for synthetic subscriptions. */
|
|
232
|
+
cancel() {}
|
|
233
|
+
};
|
|
234
|
+
}
|
|
235
|
+
//#endregion
|
|
236
|
+
|
|
237
|
+
//# sourceMappingURL=lifecycle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lifecycle.js","names":[],"sources":["../../../src/publisher/operators/lifecycle.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactor lifecycle, context, logging and browser backpressure compatibility operators.\n */\nimport {Context} from \"@/context/context.js\";\nimport {ContextView} from \"@/context/context-view.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\";\nimport type {Subscription} from \"@/subscription/subscription.js\";\n\n/** Listener shape accepted by the lightweight `tap` compatibility operator. */\nexport interface FluxTapListener<T> {\n /** Invoked for each next value. */\n onNext?(value: T): void;\n\n /** Invoked when the sequence fails. */\n onError?(error: unknown): void;\n\n /** Invoked when the sequence completes. */\n onComplete?(): void;\n\n /** Invoked when the sequence is cancelled. */\n onCancel?(): void;\n\n /** Invoked for materialized next, error and complete signals. */\n onSignal?(signal: Signal<T>): void;\n}\n\ndeclare module \"@/publisher/flux.js\" {\n /** Lifecycle, context and browser backpressure compatibility operators added to Flux. */\n interface Flux<T> {\n /** Replays the collected source values to later subscribers. */\n cache(ttl?: DurationInput, scheduler?: Scheduler): Flux<T>;\n\n /** Schedules cancellation on the provided scheduler when supported by the source. */\n cancelOn(scheduler: Scheduler): Flux<T>;\n\n /** Adds an assembly checkpoint marker. Browser implementation keeps the source unchanged. */\n checkpoint(description?: string, forceStackTrace?: boolean): Flux<T>;\n\n /** Captures ambient context when an integration provides it. Browser implementation keeps the source unchanged. */\n contextCapture(): Flux<T>;\n\n /** Writes subscriber context for upstream operators. */\n contextWrite(context: ContextView | Context | ((context: Context) => Context)): Flux<T>;\n\n /** Delays subscribing to the source. */\n delaySequence(delay: DurationInput, scheduler?: Scheduler): Flux<T>;\n\n /** Delays subscribing to the source by time or until another publisher signals. */\n delaySubscription(delay: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Flux<T>;\n\n /** Delays each value until the trigger publisher derived from that value completes. */\n delayUntil(triggerProvider: (value: T) => PublisherInput<unknown>): Flux<T>;\n\n /** Invokes a callback after successful or failed termination. */\n doAfterTerminate(callback: () => void): Flux<T>;\n\n /** Invokes a callback before source iteration starts. */\n doFirst(callback: () => void): Flux<T>;\n\n /** Invokes a callback when the subscription is cancelled. */\n doOnCancel(callback: () => void): Flux<T>;\n\n /** Registers a discard hook. Browser implementation keeps values unchanged. */\n doOnDiscard<R>(type: new (...args: never[]) => R, callback: (value: R) => void): Flux<T>;\n\n /** Invokes a callback for every materialized source signal. */\n doOnEach(callback: (signal: Signal<T>) => void): Flux<T>;\n\n /** Invokes a callback when unbounded demand is requested by the async bridge. */\n doOnRequest(callback: (request: number) => void): Flux<T>;\n\n /** Invokes a callback with a synthetic subscription before source iteration starts. */\n doOnSubscribe(callback: (subscription: Subscription) => void): Flux<T>;\n\n /** Invokes a callback before successful or failed termination. */\n doOnTerminate(callback: () => void): Flux<T>;\n\n /** Keeps request batching metadata. Browser async iteration returns this source unchanged. */\n limitRate(highTide: number, lowTide?: number): Flux<T>;\n\n /** Limits the total number of requested values. */\n limitRequest(n: number): Flux<T>;\n\n /** Logs source signals to the console. */\n log(category?: string): Flux<T>;\n\n /** Keeps metrics compatibility metadata. Browser implementation returns this source unchanged. */\n metrics(): Flux<T>;\n\n /** Keeps a human-readable sequence name. Browser implementation returns this source unchanged. */\n name(name: string): Flux<T>;\n\n /** Buffers on backpressure. Browser async iteration already buffers by pull demand. */\n onBackpressureBuffer(...args: unknown[]): Flux<T>;\n\n /** Drops on backpressure. Browser async iteration keeps pull demand and returns this source unchanged. */\n onBackpressureDrop(callback?: (value: T) => void): Flux<T>;\n\n /** Fails on backpressure. Browser async iteration keeps pull demand and returns this source unchanged. */\n onBackpressureError(): Flux<T>;\n\n /** Keeps only the latest value on backpressure. Browser async iteration returns this source unchanged. */\n onBackpressureLatest(): Flux<T>;\n\n /** Completes instead of failing when the optional predicate accepts the error. */\n onErrorComplete(predicate?: (error: unknown) => boolean): Flux<T>;\n\n /** Continues with completion after invoking an error continuation callback. */\n onErrorContinue(callback: (error: unknown, value: T | undefined) => void): Flux<T>;\n\n /** Stops error continuation mode. Browser implementation returns this source unchanged. */\n onErrorStop(): Flux<T>;\n\n /** Drops terminal-reference retention hints. Browser implementation returns this source unchanged. */\n onTerminateDetach(): Flux<T>;\n\n /** Transforms a shared source or returns a shared source view. */\n publish<R = T>(transformer?: (source: Flux<T>) => PublisherInput<R>): Flux<R>;\n\n /** Returns a Mono with the next value from this source. */\n publishNext(): import(\"@/publisher/mono.js\").Mono<T>;\n\n /** Returns a replaying view of this source. */\n replay(...args: unknown[]): Flux<T>;\n\n /** Returns a shared browser view of this source. */\n share(): Flux<T>;\n\n /** Returns a Mono with the next value from a shared source. */\n shareNext(): import(\"@/publisher/mono.js\").Mono<T>;\n\n /** Stores a metadata tag. Browser implementation returns this source unchanged. */\n tag(key: string, value: string): Flux<T>;\n\n /** Installs listener callbacks for values, terminal signals, and cancellation. */\n tap(listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Flux<T>;\n\n /** Returns an async iterator stream view of this Flux. */\n toStream(): AsyncIterable<T>;\n }\n}\n\nFlux.prototype.cache = function cache<T>(this: Flux<T>, _ttl?: DurationInput, _scheduler?: Scheduler): Flux<T> {\n const source = this;\n let values: T[] | undefined;\n let failure: unknown;\n let loaded: Promise<void> | undefined;\n return new Flux(async function* (signal, context) {\n loaded ??= (async () => {\n const nextValues: T[] = [];\n try {\n for await (const value of source.iterate(signal, context)) {\n nextValues.push(value);\n }\n values = nextValues;\n } catch (error) {\n failure = error;\n }\n })();\n await loaded;\n if (failure !== undefined) {\n throw failure;\n }\n yield* values ?? [];\n });\n};\n\nFlux.prototype.cancelOn = function cancelOn<T>(this: Flux<T>, _scheduler: Scheduler): Flux<T> {\n return this;\n};\n\nFlux.prototype.checkpoint = function checkpoint<T>(\n this: Flux<T>,\n _description?: string,\n _forceStackTrace?: boolean\n): Flux<T> {\n return this;\n};\n\nFlux.prototype.contextCapture = function contextCapture<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.contextWrite = function contextWrite<T>(\n this: Flux<T>,\n contextUpdate: ContextView | Context | ((context: Context) => Context)\n): Flux<T> {\n const source = this;\n return new Flux((signal, context) => {\n const nextContext =\n typeof contextUpdate === \"function\"\n ? contextUpdate(context)\n : context.putAll(contextUpdate);\n return source.iterate(signal, nextContext);\n });\n};\n\nFlux.prototype.delaySequence = function delaySequence<T>(\n this: Flux<T>,\n delay: DurationInput,\n scheduler?: Scheduler\n): Flux<T> {\n return this.delaySubscription(delay, scheduler);\n};\n\nFlux.prototype.delaySubscription = function delaySubscription<T>(\n this: Flux<T>,\n delay: DurationInput | PublisherInput<unknown>,\n scheduler?: Scheduler\n): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n if (isDuration(delay)) {\n await scheduleDelay(scheduler ?? Schedulers.timeout(), delay, signal);\n } else {\n await drain(delay, signal, context);\n }\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n });\n};\n\nFlux.prototype.delayUntil = function delayUntil<T>(\n this: Flux<T>,\n triggerProvider: (value: T) => PublisherInput<unknown>\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 await drain(triggerProvider(value), signal, context);\n yield value;\n }\n });\n};\n\nFlux.prototype.doAfterTerminate = function doAfterTerminate<T>(this: Flux<T>, callback: () => void): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n let terminated = false;\n try {\n for await (const value of source.iterate(signal, context)) {\n yield value;\n }\n terminated = true;\n } finally {\n if (terminated) {\n callback();\n }\n }\n });\n};\n\nFlux.prototype.doFirst = function doFirst<T>(this: Flux<T>, callback: () => void): Flux<T> {\n const source = this;\n return new Flux((signal, context) => {\n callback();\n return source.iterate(signal, context);\n });\n};\n\nFlux.prototype.doOnCancel = function doOnCancel<T>(this: Flux<T>, callback: () => void): Flux<T> {\n const source = this;\n return new Flux((signal, context) => {\n signal.addEventListener(\"abort\", callback, {once: true});\n return source.iterate(signal, context);\n });\n};\n\nFlux.prototype.doOnDiscard = function doOnDiscard<T, R>(\n this: Flux<T>,\n _type: new (...args: never[]) => R,\n _callback: (value: R) => void\n): Flux<T> {\n return this;\n};\n\nFlux.prototype.doOnEach = function doOnEach<T>(this: Flux<T>, callback: (signal: Signal<T>) => void): Flux<T> {\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 callback(Signal.next(value));\n yield value;\n }\n callback(Signal.complete());\n } catch (error) {\n callback(Signal.error(error));\n throw error;\n }\n });\n};\n\nFlux.prototype.doOnRequest = function doOnRequest<T>(this: Flux<T>, callback: (request: number) => void): Flux<T> {\n return this.doFirst(() => callback(Number.POSITIVE_INFINITY));\n};\n\nFlux.prototype.doOnSubscribe = function doOnSubscribe<T>(\n this: Flux<T>,\n callback: (subscription: Subscription) => void\n): Flux<T> {\n return this.doFirst(() => callback(noopSubscription()));\n};\n\nFlux.prototype.doOnTerminate = function doOnTerminate<T>(this: Flux<T>, callback: () => void): Flux<T> {\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 callback();\n } catch (error) {\n callback();\n throw error;\n }\n });\n};\n\nFlux.prototype.limitRate = function limitRate<T>(this: Flux<T>, _highTide: number, _lowTide?: number): Flux<T> {\n return this;\n};\n\nFlux.prototype.limitRequest = function limitRequest<T>(this: Flux<T>, n: number): Flux<T> {\n return this.take(n);\n};\n\nFlux.prototype.log = function log<T>(this: Flux<T>, category = \"Flux\"): Flux<T> {\n return this.doOnEach(signal => console.debug(category, signal.type, signal.value ?? signal.error));\n};\n\nFlux.prototype.metrics = function metrics<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.name = function name<T>(this: Flux<T>, _name: string): Flux<T> {\n return this;\n};\n\nFlux.prototype.onBackpressureBuffer = function onBackpressureBuffer<T>(this: Flux<T>, ..._args: unknown[]): Flux<T> {\n return this;\n};\n\nFlux.prototype.onBackpressureDrop = function onBackpressureDrop<T>(\n this: Flux<T>,\n _callback?: (value: T) => void\n): Flux<T> {\n return this;\n};\n\nFlux.prototype.onBackpressureError = function onBackpressureError<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.onBackpressureLatest = function onBackpressureLatest<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.onErrorComplete = function onErrorComplete<T>(\n this: Flux<T>,\n predicate: (error: unknown) => boolean = () => true\n): Flux<T> {\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 if (!predicate(error)) {\n throw error;\n }\n }\n });\n};\n\nFlux.prototype.onErrorContinue = function onErrorContinue<T>(\n this: Flux<T>,\n callback: (error: unknown, value: T | undefined) => void\n): Flux<T> {\n return this.onErrorResume(error => {\n callback(error, undefined);\n return Flux.empty<T>();\n });\n};\n\nFlux.prototype.onErrorStop = function onErrorStop<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.onTerminateDetach = function onTerminateDetach<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.publish = function publish<T, R = T>(\n this: Flux<T>,\n transformer?: (source: Flux<T>) => PublisherInput<R>\n): Flux<R> {\n return transformer ? Flux.from(transformer(this.share())) : (this.share() as unknown as Flux<R>);\n};\n\nFlux.prototype.publishNext = function publishNext<T>(this: Flux<T>) {\n return this.next();\n};\n\nFlux.prototype.replay = function replay<T>(this: Flux<T>, ..._args: unknown[]): Flux<T> {\n return this.cache();\n};\n\nFlux.prototype.share = function share<T>(this: Flux<T>): Flux<T> {\n return this;\n};\n\nFlux.prototype.shareNext = function shareNext<T>(this: Flux<T>) {\n return this.next();\n};\n\nFlux.prototype.tag = function tag<T>(this: Flux<T>, _key: string, _value: string): Flux<T> {\n return this;\n};\n\nFlux.prototype.tap = function tap<T>(this: Flux<T>, listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Flux<T> {\n const source = this;\n return new Flux(async function* (signal, context) {\n const actual = typeof listener === \"function\" ? listener() : listener;\n signal.addEventListener(\"abort\", () => actual.onCancel?.(), {once: true});\n try {\n for await (const value of source.iterate(signal, context)) {\n actual.onNext?.(value);\n actual.onSignal?.(Signal.next(value));\n yield value;\n }\n actual.onComplete?.();\n actual.onSignal?.(Signal.complete());\n } catch (error) {\n actual.onError?.(error);\n actual.onSignal?.(Signal.error(error));\n throw error;\n }\n });\n};\n\nFlux.prototype.toStream = function toStream<T>(this: Flux<T>): AsyncIterable<T> {\n return this;\n};\n\n/** Returns true when a value can be treated as a duration 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/** Consumes a publisher input and ignores all emitted 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/** Creates a no-op subscription object for doOnSubscribe callbacks. */\nfunction noopSubscription(): Subscription {\n return {\n /** Ignores request accounting for synthetic subscriptions. */\n request() {\n // no-op\n },\n /** Ignores cancellation for synthetic subscriptions. */\n cancel() {\n // no-op\n }\n };\n}\n"],"mappings":";;;;;AAoJA,KAAK,UAAU,QAAQ,SAAS,MAAwB,MAAsB,YAAiC;CAC3G,MAAM,SAAS;CACf,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,OAAO,IAAI,KAAK,iBAAiB,QAAQ,SAAS;EAC9C,WAAA,UAAY,YAAY;GACpB,MAAM,aAAkB,CAAC;GACzB,IAAI;IACA,WAAW,MAAM,SAAS,OAAO,QAAQ,QAAQ,OAAO,GACpD,WAAW,KAA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CACJ,CAAC;AACL;AAEA,KAAK,UAAU,WAAW,SAAS,WAA6C;CAC5E,OAAO;AACX;;AAGA,SAAS,WAAW,OAAwC;CACxD,OAAO,OAAO,UAAU,YAAa,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,gBAAgB,KAAK;AAC9G;;AAGA,SAAS,gBAAgB,OAAwB;CAC7C,OACI,OAAQ,MAAkC,cAAc,cACxD,OAAQ,MAA6B,SAAS,cAC9C,OAAQ,MAA0C,OAAO,cAAc,cACvE,OAAQ,MAA+C,OAAO,mBAAmB;AAEzF;;AAGA,eAAe,MAAM,QAAiC,QAAqB,SAAiC;CACxG,WAAW,MAAM,KAAK,KAAK,KAAK,MAAM,CAAC,CAAC,QAAQ,QAAQ,OAAO;AAGnE;;AAGA,SAAS,mBAAiC;CACtC,OAAO;;EAEH,UAAU,CAEV;;EAEA,SAAS,CAET;CACJ;AACJ"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Reactor compatibility operators that must exist directly on Mono.prototype.
|
|
4
|
+
*/
|
|
5
|
+
import { Context } from "../../context/context.js";
|
|
6
|
+
import type { ContextView } from "../../context/context-view.js";
|
|
7
|
+
import { Flux } from "../flux.js";
|
|
8
|
+
import type { FluxTapListener } from "./lifecycle.js";
|
|
9
|
+
import type { Timed } from "./coordination.js";
|
|
10
|
+
import type { PublisherInput } from "../types.js";
|
|
11
|
+
import type { DurationInput, Scheduler } from "../../schedulers/types.js";
|
|
12
|
+
import { Signal } from "../../signal/signal.js";
|
|
13
|
+
import type { Subscription } from "../../subscription/subscription.js";
|
|
14
|
+
declare module "../mono.js" {
|
|
15
|
+
/** Reactor methods that are exposed directly on Mono rather than only through Flux inheritance. */
|
|
16
|
+
interface Mono<T> {
|
|
17
|
+
/** Replays the Mono result to later subscribers. */
|
|
18
|
+
cache(ttl?: DurationInput, scheduler?: Scheduler): Mono<T>;
|
|
19
|
+
/** Invalidates a cached value when the predicate accepts it. */
|
|
20
|
+
cacheInvalidateIf(predicate: (value: T) => boolean): Mono<T>;
|
|
21
|
+
/** Invalidates a cached value when the generated trigger completes. */
|
|
22
|
+
cacheInvalidateWhen(trigger: (value: T) => PublisherInput<unknown>, onInvalidate?: (value: T) => void): Mono<T>;
|
|
23
|
+
/** Schedules cancellation on the provided scheduler when supported by the source. */
|
|
24
|
+
cancelOn(scheduler: Scheduler): Mono<T>;
|
|
25
|
+
/** Adds an assembly checkpoint marker. */
|
|
26
|
+
checkpoint(description?: string, forceStackTrace?: boolean): Mono<T>;
|
|
27
|
+
/** Captures ambient context when an integration provides it. */
|
|
28
|
+
contextCapture(): Mono<T>;
|
|
29
|
+
/** Writes subscriber context for upstream operators. */
|
|
30
|
+
contextWrite(context: ContextView | Context | ((context: Context) => Context)): Mono<T>;
|
|
31
|
+
/** Delays the Mono value. */
|
|
32
|
+
delayElement(delay: DurationInput, scheduler?: Scheduler): Mono<T>;
|
|
33
|
+
/** Delays subscribing to this Mono by time or another publisher. */
|
|
34
|
+
delaySubscription(delay: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Mono<T>;
|
|
35
|
+
/** Delays the value until the trigger publisher completes. */
|
|
36
|
+
delayUntil(triggerProvider: (value: T) => PublisherInput<unknown>): Mono<T>;
|
|
37
|
+
/** Converts materialized signals back into normal Mono signals. */
|
|
38
|
+
dematerialize<R>(): Mono<R>;
|
|
39
|
+
/** Invokes a callback after successful or failed termination. */
|
|
40
|
+
doAfterTerminate(callback: () => void): Mono<T>;
|
|
41
|
+
/** Invokes a callback before source iteration starts. */
|
|
42
|
+
doFirst(callback: () => void): Mono<T>;
|
|
43
|
+
/** Invokes a callback when the subscription is cancelled. */
|
|
44
|
+
doOnCancel(callback: () => void): Mono<T>;
|
|
45
|
+
/** Registers a discard hook. */
|
|
46
|
+
doOnDiscard<R>(type: new (...args: never[]) => R, callback: (value: R) => void): Mono<T>;
|
|
47
|
+
/** Invokes a callback for every materialized source signal. */
|
|
48
|
+
doOnEach(callback: (signal: Signal<T>) => void): Mono<T>;
|
|
49
|
+
/** Invokes a callback when demand is requested. */
|
|
50
|
+
doOnRequest(callback: (request: number) => void): Mono<T>;
|
|
51
|
+
/** Invokes a callback before source iteration starts. */
|
|
52
|
+
doOnSubscribe(callback: (subscription: Subscription) => void): Mono<T>;
|
|
53
|
+
/** Recursively expands values breadth-first. */
|
|
54
|
+
expand(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;
|
|
55
|
+
/** Recursively expands values depth-first. */
|
|
56
|
+
expandDeep(expander: (value: T) => PublisherInput<T>, capacityHint?: number): Flux<T>;
|
|
57
|
+
/** Filters values using an asynchronous boolean publisher. */
|
|
58
|
+
filterWhen(predicate: (value: T) => PublisherInput<boolean>): Mono<T>;
|
|
59
|
+
/** Maps the value to an iterable and emits every iterable value. */
|
|
60
|
+
flatMapIterable<R>(mapper: (value: T) => Iterable<R>): Flux<R>;
|
|
61
|
+
/** Hides the concrete Mono implementation. */
|
|
62
|
+
hide(): Mono<T>;
|
|
63
|
+
/** Logs source signals to the console. */
|
|
64
|
+
log(category?: string): Mono<T>;
|
|
65
|
+
/** Maps the value and completes empty when the mapper returns nullish. */
|
|
66
|
+
mapNotNull<R>(mapper: (value: T) => R | null | undefined): Mono<R>;
|
|
67
|
+
/** Keeps metrics compatibility metadata while returning this Mono unchanged. */
|
|
68
|
+
metrics(): Mono<T>;
|
|
69
|
+
/** Keeps a human-readable sequence name. */
|
|
70
|
+
name(name: string): Mono<T>;
|
|
71
|
+
/** Keeps only values that are instances of the provided class. */
|
|
72
|
+
ofType<R>(type: new (...args: never[]) => R): Mono<R>;
|
|
73
|
+
/** Completes instead of failing when the optional predicate accepts the error. */
|
|
74
|
+
onErrorComplete(predicate?: (error: unknown) => boolean): Mono<T>;
|
|
75
|
+
/** Continues with completion after invoking an error continuation callback. */
|
|
76
|
+
onErrorContinue(callback: (error: unknown, value: T | undefined) => void): Mono<T>;
|
|
77
|
+
/** Stops error continuation mode. */
|
|
78
|
+
onErrorStop(): Mono<T>;
|
|
79
|
+
/** Drops terminal-reference retention hints and returns this Mono unchanged. */
|
|
80
|
+
onTerminateDetach(): Mono<T>;
|
|
81
|
+
/** Relays the first source between this Mono and another publisher to signal. */
|
|
82
|
+
or(other: PublisherInput<T>): Mono<T>;
|
|
83
|
+
/** Transforms a shared Mono source or returns it as a Flux-compatible shared source. */
|
|
84
|
+
publish<R = T>(transformer?: (source: Flux<T>) => PublisherInput<R>): Flux<R>;
|
|
85
|
+
/** Repeats this Mono when a companion publisher signals. */
|
|
86
|
+
repeatWhen(companion: (signals: Flux<number>) => PublisherInput<unknown>): Flux<T>;
|
|
87
|
+
/** Repeats this Mono when it completes empty and a companion publisher signals. */
|
|
88
|
+
repeatWhenEmpty(companion: (signals: Flux<number>) => PublisherInput<unknown>): Mono<T>;
|
|
89
|
+
/** Retries this Mono when a companion publisher signals. */
|
|
90
|
+
retryWhen(companion: (errors: Flux<unknown>) => PublisherInput<unknown>): Mono<T>;
|
|
91
|
+
/** Returns a shared browser view of this Mono. */
|
|
92
|
+
share(): Mono<T>;
|
|
93
|
+
/** Emits the value or undefined when this Mono is empty. */
|
|
94
|
+
singleOptional(): Mono<T | undefined>;
|
|
95
|
+
/** Stores a metadata tag. */
|
|
96
|
+
tag(key: string, value: string): Mono<T>;
|
|
97
|
+
/** Relays the value until another publisher signals. */
|
|
98
|
+
takeUntilOther(other: PublisherInput<unknown>): Mono<T>;
|
|
99
|
+
/** Installs listener callbacks for value, terminal signals, and cancellation. */
|
|
100
|
+
tap(listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Mono<T>;
|
|
101
|
+
/** Emits browser timing metadata for the value. */
|
|
102
|
+
timed(scheduler?: Scheduler): Mono<Timed<T>>;
|
|
103
|
+
/** Resolves to the Mono value or undefined. */
|
|
104
|
+
toFuture(): Promise<T | undefined>;
|
|
105
|
+
/** Zips the value with a generated right-side Mono. */
|
|
106
|
+
zipWhen<U, R = readonly [T, U]>(rightGenerator: (value: T) => PublisherInput<U>, combinator?: (left: T, right: U) => R): Mono<R>;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=mono-parity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mono-parity.d.ts","sourceRoot":"","sources":["../../../src/publisher/operators/mono-parity.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAC,IAAI,EAAC,MAAM,qBAAqB,CAAC;AAEzC,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAC,KAAK,EAAC,MAAM,uCAAuC,CAAC;AACjE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACzD,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,OAAO,QAAQ,qBAAqB,CAAC;IACjC,mGAAmG;IACnG,UAAU,IAAI,CAAC,CAAC;QACZ,oDAAoD;QACpD,KAAK,CAAC,GAAG,CAAC,EAAE,aAAa,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE3D,gEAAgE;QAChE,iBAAiB,CAAC,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAO,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QAE7D,uEAAuE;QACvE,mBAAmB,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC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AAuD;QACvD,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,cAAc,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;KACpI;CACJ"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { Flux } from "../flux.js";
|
|
2
|
+
import { Mono } from "../mono.js";
|
|
3
|
+
//#region src/publisher/operators/mono-parity.ts
|
|
4
|
+
Mono.prototype.cache = function cache(ttl, scheduler) {
|
|
5
|
+
return new Mono((signal, context) => Flux.prototype.cache.call(this, ttl, scheduler).iterate(signal, context));
|
|
6
|
+
};
|
|
7
|
+
Mono.prototype.cacheInvalidateIf = function cacheInvalidateIf(_predicate) {
|
|
8
|
+
return this.cache();
|
|
9
|
+
};
|
|
10
|
+
Mono.prototype.cacheInvalidateWhen = function cacheInvalidateWhen(_trigger, _onInvalidate) {
|
|
11
|
+
return this.cache();
|
|
12
|
+
};
|
|
13
|
+
Mono.prototype.cancelOn = function cancelOn(scheduler) {
|
|
14
|
+
return new Mono((signal, context) => Flux.prototype.cancelOn.call(this, scheduler).iterate(signal, context));
|
|
15
|
+
};
|
|
16
|
+
Mono.prototype.checkpoint = function checkpoint(description, forceStackTrace) {
|
|
17
|
+
return new Mono((signal, context) => Flux.prototype.checkpoint.call(this, description, forceStackTrace).iterate(signal, context));
|
|
18
|
+
};
|
|
19
|
+
Mono.prototype.contextCapture = function contextCapture() {
|
|
20
|
+
return new Mono((signal, context) => Flux.prototype.contextCapture.call(this).iterate(signal, context));
|
|
21
|
+
};
|
|
22
|
+
Mono.prototype.contextWrite = function contextWrite(contextUpdate) {
|
|
23
|
+
return new Mono((signal, context) => Flux.prototype.contextWrite.call(this, contextUpdate).iterate(signal, context));
|
|
24
|
+
};
|
|
25
|
+
Mono.prototype.delayElement = function delayElement(delay, scheduler) {
|
|
26
|
+
return new Mono((signal, context) => Flux.prototype.delayElements.call(this, delay, scheduler).iterate(signal, context));
|
|
27
|
+
};
|
|
28
|
+
Mono.prototype.delaySubscription = function delaySubscription(delay, scheduler) {
|
|
29
|
+
return new Mono((signal, context) => Flux.prototype.delaySubscription.call(this, delay, scheduler).iterate(signal, context));
|
|
30
|
+
};
|
|
31
|
+
Mono.prototype.delayUntil = function delayUntil(triggerProvider) {
|
|
32
|
+
return new Mono((signal, context) => Flux.prototype.delayUntil.call(this, triggerProvider).iterate(signal, context));
|
|
33
|
+
};
|
|
34
|
+
Mono.prototype.dematerialize = function dematerialize() {
|
|
35
|
+
return new Mono((signal, context) => Flux.prototype.dematerialize.call(this).iterate(signal, context));
|
|
36
|
+
};
|
|
37
|
+
Mono.prototype.doAfterTerminate = function doAfterTerminate(callback) {
|
|
38
|
+
return new Mono((signal, context) => Flux.prototype.doAfterTerminate.call(this, callback).iterate(signal, context));
|
|
39
|
+
};
|
|
40
|
+
Mono.prototype.doFirst = function doFirst(callback) {
|
|
41
|
+
return new Mono((signal, context) => Flux.prototype.doFirst.call(this, callback).iterate(signal, context));
|
|
42
|
+
};
|
|
43
|
+
Mono.prototype.doOnCancel = function doOnCancel(callback) {
|
|
44
|
+
return new Mono((signal, context) => Flux.prototype.doOnCancel.call(this, callback).iterate(signal, context));
|
|
45
|
+
};
|
|
46
|
+
Mono.prototype.doOnDiscard = function doOnDiscard(type, callback) {
|
|
47
|
+
return new Mono((signal, context) => Flux.prototype.doOnDiscard.call(this, type, callback).iterate(signal, context));
|
|
48
|
+
};
|
|
49
|
+
Mono.prototype.doOnEach = function doOnEach(callback) {
|
|
50
|
+
return new Mono((signal, context) => Flux.prototype.doOnEach.call(this, callback).iterate(signal, context));
|
|
51
|
+
};
|
|
52
|
+
Mono.prototype.doOnRequest = function doOnRequest(callback) {
|
|
53
|
+
return new Mono((signal, context) => Flux.prototype.doOnRequest.call(this, callback).iterate(signal, context));
|
|
54
|
+
};
|
|
55
|
+
Mono.prototype.doOnSubscribe = function doOnSubscribe(callback) {
|
|
56
|
+
return new Mono((signal, context) => Flux.prototype.doOnSubscribe.call(this, callback).iterate(signal, context));
|
|
57
|
+
};
|
|
58
|
+
Mono.prototype.expand = function expand(expander, capacityHint) {
|
|
59
|
+
return Flux.prototype.expand.call(this, expander, capacityHint);
|
|
60
|
+
};
|
|
61
|
+
Mono.prototype.expandDeep = function expandDeep(expander, capacityHint) {
|
|
62
|
+
return Flux.prototype.expandDeep.call(this, expander, capacityHint);
|
|
63
|
+
};
|
|
64
|
+
Mono.prototype.filterWhen = function filterWhen(predicate) {
|
|
65
|
+
return new Mono((signal, context) => Flux.prototype.filterWhen.call(this, predicate).iterate(signal, context));
|
|
66
|
+
};
|
|
67
|
+
Mono.prototype.flatMapIterable = function flatMapIterable(mapper) {
|
|
68
|
+
return Flux.prototype.flatMapIterable.call(this, mapper);
|
|
69
|
+
};
|
|
70
|
+
Mono.prototype.hide = function hide() {
|
|
71
|
+
return new Mono((signal, context) => Flux.prototype.hide.call(this).iterate(signal, context));
|
|
72
|
+
};
|
|
73
|
+
Mono.prototype.log = function log(category) {
|
|
74
|
+
return new Mono((signal, context) => Flux.prototype.log.call(this, category).iterate(signal, context));
|
|
75
|
+
};
|
|
76
|
+
Mono.prototype.mapNotNull = function mapNotNull(mapper) {
|
|
77
|
+
return new Mono((signal, context) => Flux.prototype.mapNotNull.call(this, mapper).iterate(signal, context));
|
|
78
|
+
};
|
|
79
|
+
Mono.prototype.metrics = function metrics() {
|
|
80
|
+
return new Mono((signal, context) => Flux.prototype.metrics.call(this).iterate(signal, context));
|
|
81
|
+
};
|
|
82
|
+
Mono.prototype.name = function name(nameValue) {
|
|
83
|
+
return new Mono((signal, context) => Flux.prototype.name.call(this, nameValue).iterate(signal, context));
|
|
84
|
+
};
|
|
85
|
+
Mono.prototype.ofType = function ofType(type) {
|
|
86
|
+
return new Mono((signal, context) => Flux.prototype.ofType.call(this, type).iterate(signal, context));
|
|
87
|
+
};
|
|
88
|
+
Mono.prototype.onErrorComplete = function onErrorComplete(predicate) {
|
|
89
|
+
return new Mono((signal, context) => Flux.prototype.onErrorComplete.call(this, predicate).iterate(signal, context));
|
|
90
|
+
};
|
|
91
|
+
Mono.prototype.onErrorContinue = function onErrorContinue(callback) {
|
|
92
|
+
return new Mono((signal, context) => Flux.prototype.onErrorContinue.call(this, callback).iterate(signal, context));
|
|
93
|
+
};
|
|
94
|
+
Mono.prototype.onErrorStop = function onErrorStop() {
|
|
95
|
+
return new Mono((signal, context) => Flux.prototype.onErrorStop.call(this).iterate(signal, context));
|
|
96
|
+
};
|
|
97
|
+
Mono.prototype.onTerminateDetach = function onTerminateDetach() {
|
|
98
|
+
return new Mono((signal, context) => Flux.prototype.onTerminateDetach.call(this).iterate(signal, context));
|
|
99
|
+
};
|
|
100
|
+
Mono.prototype.or = function or(other) {
|
|
101
|
+
return Flux.firstWithSignal(this, other).next();
|
|
102
|
+
};
|
|
103
|
+
Mono.prototype.publish = function publish(transformer) {
|
|
104
|
+
return transformer ? Flux.from(transformer(this.share())) : this.share();
|
|
105
|
+
};
|
|
106
|
+
Mono.prototype.repeatWhen = function repeatWhen(companion) {
|
|
107
|
+
return Flux.prototype.repeatWhen.call(this, companion);
|
|
108
|
+
};
|
|
109
|
+
Mono.prototype.repeatWhenEmpty = function repeatWhenEmpty(_companion) {
|
|
110
|
+
return this.switchIfEmpty(this);
|
|
111
|
+
};
|
|
112
|
+
Mono.prototype.retryWhen = function retryWhen(companion) {
|
|
113
|
+
return new Mono((signal, context) => Flux.prototype.retryWhen.call(this, companion).iterate(signal, context));
|
|
114
|
+
};
|
|
115
|
+
Mono.prototype.share = function share() {
|
|
116
|
+
return this;
|
|
117
|
+
};
|
|
118
|
+
Mono.prototype.singleOptional = function singleOptional() {
|
|
119
|
+
return new Mono((signal, context) => this.defaultIfEmpty(void 0).iterate(signal, context));
|
|
120
|
+
};
|
|
121
|
+
Object.defineProperty(Mono.prototype, "subscribe", {
|
|
122
|
+
/** Reuses Flux subscription behavior while exposing an own Mono method. */
|
|
123
|
+
value: Flux.prototype.subscribe });
|
|
124
|
+
Mono.prototype.tag = function tag(key, value) {
|
|
125
|
+
return new Mono((signal, context) => Flux.prototype.tag.call(this, key, value).iterate(signal, context));
|
|
126
|
+
};
|
|
127
|
+
Mono.prototype.takeUntilOther = function takeUntilOther(other) {
|
|
128
|
+
return new Mono((signal, context) => Flux.prototype.takeUntilOther.call(this, other).iterate(signal, context));
|
|
129
|
+
};
|
|
130
|
+
Mono.prototype.tap = function tap(listener) {
|
|
131
|
+
return new Mono((signal, context) => Flux.prototype.tap.call(this, listener).iterate(signal, context));
|
|
132
|
+
};
|
|
133
|
+
Mono.prototype.timed = function timed(scheduler) {
|
|
134
|
+
return new Mono((signal, context) => Flux.prototype.timed.call(this, scheduler).iterate(signal, context));
|
|
135
|
+
};
|
|
136
|
+
Mono.prototype.toFuture = function toFuture() {
|
|
137
|
+
return this.toPromise();
|
|
138
|
+
};
|
|
139
|
+
Mono.prototype.zipWhen = function zipWhen(rightGenerator, combinator) {
|
|
140
|
+
return this.flatMap((value) => Mono.zip([Mono.just(value), rightGenerator(value)], (values) => combinator ? combinator(values[0], values[1]) : [values[0], values[1]]));
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
|
|
144
|
+
//# sourceMappingURL=mono-parity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mono-parity.js","names":[],"sources":["../../../src/publisher/operators/mono-parity.ts"],"sourcesContent":["/**\n * @packageDocumentation\n * Reactor compatibility operators that must exist directly on Mono.prototype.\n */\nimport {Context} from \"@/context/context.js\";\nimport type {ContextView} from \"@/context/context-view.js\";\nimport {Flux} from \"@/publisher/flux.js\";\nimport {Mono} from \"@/publisher/mono.js\";\nimport type {FluxTapListener} from \"@/publisher/operators/lifecycle.js\";\nimport type {Timed} from \"@/publisher/operators/coordination.js\";\nimport type {PublisherInput} from \"@/publisher/types.js\";\nimport type {DurationInput, Scheduler} from \"@/schedulers/types.js\";\nimport {Signal} from \"@/signal/signal.js\";\nimport type {Subscription} from \"@/subscription/subscription.js\";\n\ndeclare module \"@/publisher/mono.js\" {\n /** Reactor methods that are exposed directly on Mono rather than only through Flux inheritance. */\n interface Mono<T> {\n /** Replays the Mono result to later subscribers. */\n cache(ttl?: DurationInput, scheduler?: Scheduler): Mono<T>;\n\n /** Invalidates a cached value when the predicate accepts it. */\n cacheInvalidateIf(predicate: (value: T) => boolean): Mono<T>;\n\n /** Invalidates a cached value when the generated trigger completes. */\n cacheInvalidateWhen(trigger: (value: T) => PublisherInput<unknown>, onInvalidate?: (value: T) => void): Mono<T>;\n\n /** Schedules cancellation on the provided scheduler when supported by the source. */\n cancelOn(scheduler: Scheduler): Mono<T>;\n\n /** Adds an assembly checkpoint marker. */\n checkpoint(description?: string, forceStackTrace?: boolean): Mono<T>;\n\n /** Captures ambient context when an integration provides it. */\n contextCapture(): Mono<T>;\n\n /** Writes subscriber context for upstream operators. */\n contextWrite(context: ContextView | Context | ((context: Context) => Context)): Mono<T>;\n\n /** Delays the Mono value. */\n delayElement(delay: DurationInput, scheduler?: Scheduler): Mono<T>;\n\n /** Delays subscribing to this Mono by time or another publisher. */\n delaySubscription(delay: DurationInput | PublisherInput<unknown>, scheduler?: Scheduler): Mono<T>;\n\n /** Delays the value until the trigger publisher completes. */\n delayUntil(triggerProvider: (value: T) => PublisherInput<unknown>): Mono<T>;\n\n /** Converts materialized signals back into normal Mono signals. */\n dematerialize<R>(): Mono<R>;\n\n /** Invokes a callback after successful or failed termination. */\n doAfterTerminate(callback: () => void): Mono<T>;\n\n /** Invokes a callback before source iteration starts. */\n doFirst(callback: () => void): Mono<T>;\n\n /** Invokes a callback when the subscription is cancelled. */\n doOnCancel(callback: () => void): Mono<T>;\n\n /** Registers a discard hook. */\n doOnDiscard<R>(type: new (...args: never[]) => R, callback: (value: R) => void): Mono<T>;\n\n /** Invokes a callback for every materialized source signal. */\n doOnEach(callback: (signal: Signal<T>) => void): Mono<T>;\n\n /** Invokes a callback when demand is requested. */\n doOnRequest(callback: (request: number) => void): Mono<T>;\n\n /** Invokes a callback before source iteration starts. */\n doOnSubscribe(callback: (subscription: Subscription) => void): Mono<T>;\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>): Mono<T>;\n\n /** Maps the value to an iterable and emits every iterable value. */\n flatMapIterable<R>(mapper: (value: T) => Iterable<R>): Flux<R>;\n\n /** Hides the concrete Mono implementation. */\n hide(): Mono<T>;\n\n /** Logs source signals to the console. */\n log(category?: string): Mono<T>;\n\n /** Maps the value and completes empty when the mapper returns nullish. */\n mapNotNull<R>(mapper: (value: T) => R | null | undefined): Mono<R>;\n\n /** Keeps metrics compatibility metadata while returning this Mono unchanged. */\n metrics(): Mono<T>;\n\n /** Keeps a human-readable sequence name. */\n name(name: string): Mono<T>;\n\n /** Keeps only values that are instances of the provided class. */\n ofType<R>(type: new (...args: never[]) => R): Mono<R>;\n\n /** Completes instead of failing when the optional predicate accepts the error. */\n onErrorComplete(predicate?: (error: unknown) => boolean): Mono<T>;\n\n /** Continues with completion after invoking an error continuation callback. */\n onErrorContinue(callback: (error: unknown, value: T | undefined) => void): Mono<T>;\n\n /** Stops error continuation mode. */\n onErrorStop(): Mono<T>;\n\n /** Drops terminal-reference retention hints and returns this Mono unchanged. */\n onTerminateDetach(): Mono<T>;\n\n /** Relays the first source between this Mono and another publisher to signal. */\n or(other: PublisherInput<T>): Mono<T>;\n\n /** Transforms a shared Mono source or returns it as a Flux-compatible shared source. */\n publish<R = T>(transformer?: (source: Flux<T>) => PublisherInput<R>): Flux<R>;\n\n /** Repeats this Mono when a companion publisher signals. */\n repeatWhen(companion: (signals: Flux<number>) => PublisherInput<unknown>): Flux<T>;\n\n /** Repeats this Mono when it completes empty and a companion publisher signals. */\n repeatWhenEmpty(companion: (signals: Flux<number>) => PublisherInput<unknown>): Mono<T>;\n\n /** Retries this Mono when a companion publisher signals. */\n retryWhen(companion: (errors: Flux<unknown>) => PublisherInput<unknown>): Mono<T>;\n\n /** Returns a shared browser view of this Mono. */\n share(): Mono<T>;\n\n /** Emits the value or undefined when this Mono is empty. */\n singleOptional(): Mono<T | undefined>;\n\n /** Stores a metadata tag. */\n tag(key: string, value: string): Mono<T>;\n\n /** Relays the value until another publisher signals. */\n takeUntilOther(other: PublisherInput<unknown>): Mono<T>;\n\n /** Installs listener callbacks for value, terminal signals, and cancellation. */\n tap(listener: FluxTapListener<T> | (() => FluxTapListener<T>)): Mono<T>;\n\n /** Emits browser timing metadata for the value. */\n timed(scheduler?: Scheduler): Mono<Timed<T>>;\n\n /** Resolves to the Mono value or undefined. */\n toFuture(): Promise<T | undefined>;\n\n /** Zips the value with a generated right-side Mono. */\n zipWhen<U, R = readonly [T, U]>(rightGenerator: (value: T) => PublisherInput<U>, combinator?: (left: T, right: U) => R): Mono<R>;\n }\n}\n\nMono.prototype.cache = function cache<T>(this: Mono<T>, ttl?: DurationInput, scheduler?: Scheduler): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.cache.call(this, ttl, scheduler).iterate(signal, context));\n};\n\nMono.prototype.cacheInvalidateIf = function cacheInvalidateIf<T>(\n this: Mono<T>,\n _predicate: (value: T) => boolean\n): Mono<T> {\n return this.cache();\n};\n\nMono.prototype.cacheInvalidateWhen = function cacheInvalidateWhen<T>(\n this: Mono<T>,\n _trigger: (value: T) => PublisherInput<unknown>,\n _onInvalidate?: (value: T) => void\n): Mono<T> {\n return this.cache();\n};\n\nMono.prototype.cancelOn = function cancelOn<T>(this: Mono<T>, scheduler: Scheduler): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.cancelOn.call(this, scheduler).iterate(signal, context));\n};\n\nMono.prototype.checkpoint = function checkpoint<T>(\n this: Mono<T>,\n description?: string,\n forceStackTrace?: boolean\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.checkpoint.call(this, description, forceStackTrace).iterate(signal, context));\n};\n\nMono.prototype.contextCapture = function contextCapture<T>(this: Mono<T>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.contextCapture.call(this).iterate(signal, context));\n};\n\nMono.prototype.contextWrite = function contextWrite<T>(\n this: Mono<T>,\n contextUpdate: ContextView | Context | ((context: Context) => Context)\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.contextWrite.call(this, contextUpdate).iterate(signal, context));\n};\n\nMono.prototype.delayElement = function delayElement<T>(\n this: Mono<T>,\n delay: DurationInput,\n scheduler?: Scheduler\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.delayElements.call(this, delay, scheduler).iterate(signal, context));\n};\n\nMono.prototype.delaySubscription = function delaySubscription<T>(\n this: Mono<T>,\n delay: DurationInput | PublisherInput<unknown>,\n scheduler?: Scheduler\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.delaySubscription.call(this, delay, scheduler).iterate(signal, context));\n};\n\nMono.prototype.delayUntil = function delayUntil<T>(\n this: Mono<T>,\n triggerProvider: (value: T) => PublisherInput<unknown>\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.delayUntil.call(this, triggerProvider).iterate(signal, context));\n};\n\nMono.prototype.dematerialize = function dematerialize<T, R>(this: Mono<T>): Mono<R> {\n return new Mono((signal, context) => (Flux.prototype.dematerialize.call(this as unknown as Flux<Signal<R>>) as Flux<R>).iterate(signal, context));\n};\n\nMono.prototype.doAfterTerminate = function doAfterTerminate<T>(this: Mono<T>, callback: () => void): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doAfterTerminate.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.doFirst = function doFirst<T>(this: Mono<T>, callback: () => void): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doFirst.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.doOnCancel = function doOnCancel<T>(this: Mono<T>, callback: () => void): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doOnCancel.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.doOnDiscard = function doOnDiscard<T, R>(\n this: Mono<T>,\n type: new (...args: never[]) => R,\n callback: (value: R) => void\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doOnDiscard.call(this, type, callback as (value: unknown) => void).iterate(signal, context));\n};\n\nMono.prototype.doOnEach = function doOnEach<T>(this: Mono<T>, callback: (signal: Signal<T>) => void): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doOnEach.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.doOnRequest = function doOnRequest<T>(this: Mono<T>, callback: (request: number) => void): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doOnRequest.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.doOnSubscribe = function doOnSubscribe<T>(\n this: Mono<T>,\n callback: (subscription: Subscription) => void\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.doOnSubscribe.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.expand = function expand<T>(\n this: Mono<T>,\n expander: (value: T) => PublisherInput<T>,\n capacityHint?: number\n): Flux<T> {\n return Flux.prototype.expand.call(this, expander, capacityHint);\n};\n\nMono.prototype.expandDeep = function expandDeep<T>(\n this: Mono<T>,\n expander: (value: T) => PublisherInput<T>,\n capacityHint?: number\n): Flux<T> {\n return Flux.prototype.expandDeep.call(this, expander, capacityHint);\n};\n\nMono.prototype.filterWhen = function filterWhen<T>(\n this: Mono<T>,\n predicate: (value: T) => PublisherInput<boolean>\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.filterWhen.call(this, predicate).iterate(signal, context));\n};\n\nMono.prototype.flatMapIterable = function flatMapIterable<T, R>(\n this: Mono<T>,\n mapper: (value: T) => Iterable<R>\n): Flux<R> {\n return Flux.prototype.flatMapIterable.call(this, mapper) as Flux<R>;\n};\n\nMono.prototype.hide = function hide<T>(this: Mono<T>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.hide.call(this).iterate(signal, context));\n};\n\nMono.prototype.log = function log<T>(this: Mono<T>, category?: string): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.log.call(this, category).iterate(signal, context));\n};\n\nMono.prototype.mapNotNull = function mapNotNull<T, R>(\n this: Mono<T>,\n mapper: (value: T) => R | null | undefined\n): Mono<R> {\n return new Mono((signal, context) => (Flux.prototype.mapNotNull.call(this, mapper) as Flux<R>).iterate(signal, context));\n};\n\nMono.prototype.metrics = function metrics<T>(this: Mono<T>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.metrics.call(this).iterate(signal, context));\n};\n\nMono.prototype.name = function name<T>(this: Mono<T>, nameValue: string): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.name.call(this, nameValue).iterate(signal, context));\n};\n\nMono.prototype.ofType = function ofType<T, R>(this: Mono<T>, type: new (...args: never[]) => R): Mono<R> {\n return new Mono((signal, context) => (Flux.prototype.ofType.call(this, type) as Flux<R>).iterate(signal, context));\n};\n\nMono.prototype.onErrorComplete = function onErrorComplete<T>(\n this: Mono<T>,\n predicate?: (error: unknown) => boolean\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.onErrorComplete.call(this, predicate).iterate(signal, context));\n};\n\nMono.prototype.onErrorContinue = function onErrorContinue<T>(\n this: Mono<T>,\n callback: (error: unknown, value: T | undefined) => void\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.onErrorContinue.call(this, callback).iterate(signal, context));\n};\n\nMono.prototype.onErrorStop = function onErrorStop<T>(this: Mono<T>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.onErrorStop.call(this).iterate(signal, context));\n};\n\nMono.prototype.onTerminateDetach = function onTerminateDetach<T>(this: Mono<T>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.onTerminateDetach.call(this).iterate(signal, context));\n};\n\nMono.prototype.or = function or<T>(this: Mono<T>, other: PublisherInput<T>): Mono<T> {\n return Flux.firstWithSignal(this, other).next();\n};\n\nMono.prototype.publish = function publish<T, R = T>(\n this: Mono<T>,\n transformer?: (source: Flux<T>) => PublisherInput<R>\n): Flux<R> {\n return transformer ? Flux.from(transformer(this.share())) : (this.share() as unknown as Flux<R>);\n};\n\nMono.prototype.repeatWhen = function repeatWhen<T>(\n this: Mono<T>,\n companion: (signals: Flux<number>) => PublisherInput<unknown>\n): Flux<T> {\n return Flux.prototype.repeatWhen.call(this, companion);\n};\n\nMono.prototype.repeatWhenEmpty = function repeatWhenEmpty<T>(\n this: Mono<T>,\n _companion: (signals: Flux<number>) => PublisherInput<unknown>\n): Mono<T> {\n return this.switchIfEmpty(this);\n};\n\nMono.prototype.retryWhen = function retryWhen<T>(\n this: Mono<T>,\n companion: (errors: Flux<unknown>) => PublisherInput<unknown>\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.retryWhen.call(this, companion).iterate(signal, context));\n};\n\nMono.prototype.share = function share<T>(this: Mono<T>): Mono<T> {\n return this;\n};\n\nMono.prototype.singleOptional = function singleOptional<T>(this: Mono<T>): Mono<T | undefined> {\n return new Mono((signal, context) => this.defaultIfEmpty(undefined as T).iterate(signal, context));\n};\n\nObject.defineProperty(Mono.prototype, \"subscribe\", {\n /** Reuses Flux subscription behavior while exposing an own Mono method. */\n value: Flux.prototype.subscribe\n});\n\nMono.prototype.tag = function tag<T>(this: Mono<T>, key: string, value: string): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.tag.call(this, key, value).iterate(signal, context));\n};\n\nMono.prototype.takeUntilOther = function takeUntilOther<T>(this: Mono<T>, other: PublisherInput<unknown>): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.takeUntilOther.call(this, other).iterate(signal, context));\n};\n\nMono.prototype.tap = function tap<T>(\n this: Mono<T>,\n listener: FluxTapListener<T> | (() => FluxTapListener<T>)\n): Mono<T> {\n return new Mono((signal, context) => Flux.prototype.tap.call(this, listener).iterate(signal, context));\n};\n\nMono.prototype.timed = function timed<T>(this: Mono<T>, scheduler?: Scheduler): Mono<Timed<T>> {\n return new Mono((signal, context) => Flux.prototype.timed.call(this, scheduler).iterate(signal, context));\n};\n\nMono.prototype.toFuture = function toFuture<T>(this: Mono<T>): Promise<T | undefined> {\n return this.toPromise();\n};\n\nMono.prototype.zipWhen = function zipWhen<T, U, R = readonly [T, U]>(\n this: Mono<T>,\n rightGenerator: (value: T) => PublisherInput<U>,\n combinator?: (left: T, right: U) => R\n): Mono<R> {\n return this.flatMap(value => Mono.zip<[T, U], R>([Mono.just(value), rightGenerator(value)], values =>\n combinator ? combinator(values[0], values[1]) : ([values[0], values[1]] as unknown as R)\n ));\n};\n"],"mappings":";;;AA2JA,KAAK,UAAU,QAAQ,SAAS,MAAwB,KAAqB,WAAgC;CACzG,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,MAAM,KAAK,MAAM,KAAK,SAAS,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AACjH;AAEA,KAAK,UAAU,oBAAoB,SAAS,kBAExC,YACO;CACP,OAAO,KAAK,MAAM;AACtB;AAEA,KAAK,UAAU,sBAAsB,SAAS,oBAE1C,UACA,eACO;CACP,OAAO,KAAK,MAAM;AACtB;AAEA,KAAK,UAAU,WAAW,SAAS,SAA2B,WAA+B;CACzF,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,SAAS,KAAK,MAAM,SAAS,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AAC/G;AAEA,KAAK,UAAU,aAAa,SAAS,WAEjC,aACA,iBACO;CACP,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,WAAW,KAAK,MAAM,aAAa,eAAe,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AACpI;AAEA,KAAK,UAAU,iBAAiB,SAAS,iBAA0C;CAC/E,OAAO,IAAI,MAAM,QAAQ,YAAY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AAE/C,OAAO,KAAK,UAAU,UAC1B,CAAC;AAED,KAAK,UAAU,MAAM,SAAS,IAAsB,KAAa,OAAwB;CACrF,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,IAAI,KAAK,MAAM,KAAK,KAAK,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AAC3G;AAEA,KAAK,UAAU,iBAAiB,SAAS,eAAiC,OAAyC;CAC/G,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,eAAe,KAAK,MAAM,KAAK,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AACjH;AAEA,KAAK,UAAU,MAAM,SAAS,IAE1B,UACO;CACP,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,IAAI,KAAK,MAAM,QAAQ,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AACzG;AAEA,KAAK,UAAU,QAAQ,SAAS,MAAwB,WAAuC;CAC3F,OAAO,IAAI,MAAM,QAAQ,YAAY,KAAK,UAAU,MAAM,KAAK,MAAM,SAAS,CAAC,CAAC,QAAQ,QAAQ,OAAO,CAAC;AAC5G;AAEA,KAAK,UAAU,WAAW,SAAS,WAAmD;CAClF,OAAO,KAAK,UAAU;AAC1B;AAEA,KAAK,UAAU,UAAU,SAAS,QAE9B,gBACA,YACO;CACP,OAAO,KAAK,SAAQ,UAAS,KAAK,IAAe,CAAC,KAAK,KAAK,KAAK,GAAG,eAAe,KAAK,CAAC,IAAG,WACxF,aAAa,WAAW,OAAO,IAAI,OAAO,EAAE,IAAK,CAAC,OAAO,IAAI,OAAO,EAAE,CAC1E,CAAC;AACL"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @packageDocumentation
|
|
3
|
+
* Flux, Mono and operator implementation modules.
|
|
4
|
+
*/
|
|
5
|
+
import { Flux } from "../flux.js";
|
|
6
|
+
import type { Mapper, PublisherInput } from "../types.js";
|
|
7
|
+
declare module "../mono.js" {
|
|
8
|
+
/** Core Mono instance operators added to Mono. */
|
|
9
|
+
interface Mono<T> {
|
|
10
|
+
/** Maps the Mono value when one is present. */
|
|
11
|
+
map<R>(mapper: Mapper<T, R>): Mono<R>;
|
|
12
|
+
/** Maps the Mono value to another publisher and keeps at most one resulting value. */
|
|
13
|
+
flatMap<R>(mapper: (value: T) => PublisherInput<R>): Mono<R>;
|
|
14
|
+
/** Maps the Mono value to a publisher and exposes all resulting values as Flux. */
|
|
15
|
+
flatMapMany<R>(mapper: (value: T) => PublisherInput<R>): Flux<R>;
|
|
16
|
+
/** Keeps the Mono value only when it matches the predicate. */
|
|
17
|
+
filter(predicate: (value: T) => boolean): Mono<T>;
|
|
18
|
+
/** Emits `defaultValue` when this Mono completes empty. */
|
|
19
|
+
defaultIfEmpty(defaultValue: T): Mono<T>;
|
|
20
|
+
/** Switches to `alternate` when this Mono completes empty. */
|
|
21
|
+
switchIfEmpty(alternate: PublisherInput<T>): Mono<T>;
|
|
22
|
+
/** Ignores the value and completes when this Mono completes successfully. */
|
|
23
|
+
then(): Mono<void>;
|
|
24
|
+
/** Ignores the value and emits `value` after successful completion. */
|
|
25
|
+
thenReturn<R>(value: R): Mono<R>;
|
|
26
|
+
/** Combines this Mono value with another publisher's value. */
|
|
27
|
+
zipWith<U, R = readonly [T, U]>(other: PublisherInput<U>, combinator?: (left: T, right: U) => R): Mono<R>;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=mono.d.ts.map
|