@mearie/core 0.0.1-next.5 → 0.1.2
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/dist/index-BJ3Ktp8q.d.ts +405 -0
- package/dist/index-CrxalFAt.d.cts +405 -0
- package/dist/index.cjs +47 -586
- package/dist/index.d.cts +1 -31
- package/dist/index.d.ts +1 -31
- package/dist/index.js +2 -540
- package/dist/stream/index.cjs +26 -0
- package/dist/stream/index.d.cts +2 -0
- package/dist/stream/index.d.ts +2 -0
- package/dist/stream/index.js +3 -0
- package/dist/stream-DXHFB0xP.cjs +856 -0
- package/dist/stream-DiNE6b2z.js +712 -0
- package/package.json +2 -2
|
@@ -0,0 +1,405 @@
|
|
|
1
|
+
//#region src/stream/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Subscription allows cancelling a stream and cleaning up resources.
|
|
4
|
+
*/
|
|
5
|
+
type Subscription = {
|
|
6
|
+
/**
|
|
7
|
+
* Cancel the stream and clean up resources.
|
|
8
|
+
*/
|
|
9
|
+
unsubscribe(): void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Sink receives values from a Source.
|
|
13
|
+
*/
|
|
14
|
+
type Sink<T> = {
|
|
15
|
+
/**
|
|
16
|
+
* Receive a data value.
|
|
17
|
+
* @param value - The data value.
|
|
18
|
+
*/
|
|
19
|
+
next(value: T): void;
|
|
20
|
+
/**
|
|
21
|
+
* Receive completion signal.
|
|
22
|
+
*/
|
|
23
|
+
complete(): void;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Source is a function that accepts a Sink and returns a Subscription.
|
|
27
|
+
* When called, it starts pushing values to the sink.
|
|
28
|
+
* @returns A subscription that can be used to cancel the stream.
|
|
29
|
+
*/
|
|
30
|
+
type Source<T> = (sink: Sink<T>) => Subscription;
|
|
31
|
+
/**
|
|
32
|
+
* Operator transforms one Source into another.
|
|
33
|
+
*/
|
|
34
|
+
type Operator<T, R = T> = (source: Source<T>) => Source<R>;
|
|
35
|
+
//#endregion
|
|
36
|
+
//#region src/stream/pipe.d.ts
|
|
37
|
+
/**
|
|
38
|
+
* Pipes a source through a series of operators.
|
|
39
|
+
* @param source - The source stream.
|
|
40
|
+
* @returns The source itself.
|
|
41
|
+
*/
|
|
42
|
+
declare function pipe<A>(source: Source<A>): Source<A>;
|
|
43
|
+
/**
|
|
44
|
+
* @param source - The source stream.
|
|
45
|
+
* @param op1 - The operator or sink.
|
|
46
|
+
* @returns The result of the operator/sink.
|
|
47
|
+
*/
|
|
48
|
+
declare function pipe<A, B>(source: Source<A>, op1: (source: Source<A>) => B): B;
|
|
49
|
+
/**
|
|
50
|
+
* @param source - The source stream.
|
|
51
|
+
* @param op1 - The first operator.
|
|
52
|
+
* @param op2 - The second operator or sink.
|
|
53
|
+
* @returns The result of the last operator/sink.
|
|
54
|
+
*/
|
|
55
|
+
declare function pipe<A, B, C>(source: Source<A>, op1: Operator<A, B>, op2: (source: Source<B>) => C): C;
|
|
56
|
+
/**
|
|
57
|
+
* @param source - The source stream.
|
|
58
|
+
* @param op1 - The first operator.
|
|
59
|
+
* @param op2 - The second operator.
|
|
60
|
+
* @param op3 - The third operator or sink.
|
|
61
|
+
* @returns The result of the last operator/sink.
|
|
62
|
+
*/
|
|
63
|
+
declare function pipe<A, B, C, D>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: (source: Source<C>) => D): D;
|
|
64
|
+
/**
|
|
65
|
+
* @param source - The source stream.
|
|
66
|
+
* @param op1 - The first operator.
|
|
67
|
+
* @param op2 - The second operator.
|
|
68
|
+
* @param op3 - The third operator.
|
|
69
|
+
* @param op4 - The fourth operator or sink.
|
|
70
|
+
* @returns The result of the last operator/sink.
|
|
71
|
+
*/
|
|
72
|
+
declare function pipe<A, B, C, D, E>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: (source: Source<D>) => E): E;
|
|
73
|
+
/**
|
|
74
|
+
* @param source - The source stream.
|
|
75
|
+
* @param op1 - The first operator.
|
|
76
|
+
* @param op2 - The second operator.
|
|
77
|
+
* @param op3 - The third operator.
|
|
78
|
+
* @param op4 - The fourth operator.
|
|
79
|
+
* @param op5 - The fifth operator or sink.
|
|
80
|
+
* @returns The result of the last operator/sink.
|
|
81
|
+
*/
|
|
82
|
+
declare function pipe<A, B, C, D, E, F>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: (source: Source<E>) => F): F;
|
|
83
|
+
/**
|
|
84
|
+
* @param source - The source stream.
|
|
85
|
+
* @param op1 - The first operator.
|
|
86
|
+
* @param op2 - The second operator.
|
|
87
|
+
* @param op3 - The third operator.
|
|
88
|
+
* @param op4 - The fourth operator.
|
|
89
|
+
* @param op5 - The fifth operator.
|
|
90
|
+
* @param op6 - The sixth operator or sink.
|
|
91
|
+
* @returns The result of the last operator/sink.
|
|
92
|
+
*/
|
|
93
|
+
declare function pipe<A, B, C, D, E, F, G>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: (source: Source<F>) => G): G;
|
|
94
|
+
/**
|
|
95
|
+
* @param source - The source stream.
|
|
96
|
+
* @param op1 - The first operator.
|
|
97
|
+
* @param op2 - The second operator.
|
|
98
|
+
* @param op3 - The third operator.
|
|
99
|
+
* @param op4 - The fourth operator.
|
|
100
|
+
* @param op5 - The fifth operator.
|
|
101
|
+
* @param op6 - The sixth operator.
|
|
102
|
+
* @param op7 - The seventh operator or sink.
|
|
103
|
+
* @returns The result of the last operator/sink.
|
|
104
|
+
*/
|
|
105
|
+
declare function pipe<A, B, C, D, E, F, G, H>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: Operator<F, G>, op7: (source: Source<G>) => H): H;
|
|
106
|
+
/**
|
|
107
|
+
* @param source - The source stream.
|
|
108
|
+
* @param op1 - The first operator.
|
|
109
|
+
* @param op2 - The second operator.
|
|
110
|
+
* @param op3 - The third operator.
|
|
111
|
+
* @param op4 - The fourth operator.
|
|
112
|
+
* @param op5 - The fifth operator.
|
|
113
|
+
* @param op6 - The sixth operator.
|
|
114
|
+
* @param op7 - The seventh operator.
|
|
115
|
+
* @param op8 - The eighth operator or sink.
|
|
116
|
+
* @returns The result of the last operator/sink.
|
|
117
|
+
*/
|
|
118
|
+
declare function pipe<A, B, C, D, E, F, G, H, I>(source: Source<A>, op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: Operator<F, G>, op7: Operator<G, H>, op8: (source: Source<H>) => I): I;
|
|
119
|
+
//#endregion
|
|
120
|
+
//#region src/stream/compose.d.ts
|
|
121
|
+
/**
|
|
122
|
+
* Composes a single operator.
|
|
123
|
+
* @param op1 - The operator.
|
|
124
|
+
* @returns The operator itself.
|
|
125
|
+
*/
|
|
126
|
+
declare function compose<A, B>(op1: Operator<A, B>): Operator<A, B>;
|
|
127
|
+
/**
|
|
128
|
+
* Composes two operators into one.
|
|
129
|
+
* @param op1 - The first operator.
|
|
130
|
+
* @param op2 - The second operator.
|
|
131
|
+
* @returns A composed operator.
|
|
132
|
+
*/
|
|
133
|
+
declare function compose<A, B, C>(op1: Operator<A, B>, op2: Operator<B, C>): Operator<A, C>;
|
|
134
|
+
/**
|
|
135
|
+
* Composes three operators into one.
|
|
136
|
+
* @param op1 - The first operator.
|
|
137
|
+
* @param op2 - The second operator.
|
|
138
|
+
* @param op3 - The third operator.
|
|
139
|
+
* @returns A composed operator.
|
|
140
|
+
*/
|
|
141
|
+
declare function compose<A, B, C, D>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>): Operator<A, D>;
|
|
142
|
+
/**
|
|
143
|
+
* Composes four operators into one.
|
|
144
|
+
* @param op1 - The first operator.
|
|
145
|
+
* @param op2 - The second operator.
|
|
146
|
+
* @param op3 - The third operator.
|
|
147
|
+
* @param op4 - The fourth operator.
|
|
148
|
+
* @returns A composed operator.
|
|
149
|
+
*/
|
|
150
|
+
declare function compose<A, B, C, D, E>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>): Operator<A, E>;
|
|
151
|
+
/**
|
|
152
|
+
* Composes five operators into one.
|
|
153
|
+
* @param op1 - The first operator.
|
|
154
|
+
* @param op2 - The second operator.
|
|
155
|
+
* @param op3 - The third operator.
|
|
156
|
+
* @param op4 - The fourth operator.
|
|
157
|
+
* @param op5 - The fifth operator.
|
|
158
|
+
* @returns A composed operator.
|
|
159
|
+
*/
|
|
160
|
+
declare function compose<A, B, C, D, E, F>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>): Operator<A, F>;
|
|
161
|
+
/**
|
|
162
|
+
* Composes six operators into one.
|
|
163
|
+
* @param op1 - The first operator.
|
|
164
|
+
* @param op2 - The second operator.
|
|
165
|
+
* @param op3 - The third operator.
|
|
166
|
+
* @param op4 - The fourth operator.
|
|
167
|
+
* @param op5 - The fifth operator.
|
|
168
|
+
* @param op6 - The sixth operator.
|
|
169
|
+
* @returns A composed operator.
|
|
170
|
+
*/
|
|
171
|
+
declare function compose<A, B, C, D, E, F, G>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: Operator<F, G>): Operator<A, G>;
|
|
172
|
+
/**
|
|
173
|
+
* Composes seven operators into one.
|
|
174
|
+
* @param op1 - The first operator.
|
|
175
|
+
* @param op2 - The second operator.
|
|
176
|
+
* @param op3 - The third operator.
|
|
177
|
+
* @param op4 - The fourth operator.
|
|
178
|
+
* @param op5 - The fifth operator.
|
|
179
|
+
* @param op6 - The sixth operator.
|
|
180
|
+
* @param op7 - The seventh operator.
|
|
181
|
+
* @returns A composed operator.
|
|
182
|
+
*/
|
|
183
|
+
declare function compose<A, B, C, D, E, F, G, H>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: Operator<F, G>, op7: Operator<G, H>): Operator<A, H>;
|
|
184
|
+
/**
|
|
185
|
+
* Composes eight operators into one.
|
|
186
|
+
* @param op1 - The first operator.
|
|
187
|
+
* @param op2 - The second operator.
|
|
188
|
+
* @param op3 - The third operator.
|
|
189
|
+
* @param op4 - The fourth operator.
|
|
190
|
+
* @param op5 - The fifth operator.
|
|
191
|
+
* @param op6 - The sixth operator.
|
|
192
|
+
* @param op7 - The seventh operator.
|
|
193
|
+
* @param op8 - The eighth operator.
|
|
194
|
+
* @returns A composed operator.
|
|
195
|
+
*/
|
|
196
|
+
declare function compose<A, B, C, D, E, F, G, H, I>(op1: Operator<A, B>, op2: Operator<B, C>, op3: Operator<C, D>, op4: Operator<D, E>, op5: Operator<E, F>, op6: Operator<F, G>, op7: Operator<G, H>, op8: Operator<H, I>): Operator<A, I>;
|
|
197
|
+
//#endregion
|
|
198
|
+
//#region src/stream/sinks/subscribe.d.ts
|
|
199
|
+
/**
|
|
200
|
+
* Observer pattern for consuming values from a Source.
|
|
201
|
+
*/
|
|
202
|
+
type Observer<T> = {
|
|
203
|
+
/**
|
|
204
|
+
* Called when the source emits a value.
|
|
205
|
+
* @param value - The emitted value.
|
|
206
|
+
*/
|
|
207
|
+
next?: (value: T) => void;
|
|
208
|
+
/**
|
|
209
|
+
* Called when the source completes.
|
|
210
|
+
*/
|
|
211
|
+
complete?: () => void;
|
|
212
|
+
};
|
|
213
|
+
/**
|
|
214
|
+
* Subscribe to a Source with an Observer.
|
|
215
|
+
* This is a terminal operator that starts the source execution.
|
|
216
|
+
* @param observer - The observer to receive values.
|
|
217
|
+
* @returns A function that takes a source and returns a subscription.
|
|
218
|
+
*/
|
|
219
|
+
declare const subscribe: <T>(observer: Observer<T>) => (source: Source<T>) => (() => void);
|
|
220
|
+
//#endregion
|
|
221
|
+
//#region src/stream/sinks/publish.d.ts
|
|
222
|
+
declare const publish: <T>(source: Source<T>) => void;
|
|
223
|
+
//#endregion
|
|
224
|
+
//#region src/stream/sinks/collect.d.ts
|
|
225
|
+
/**
|
|
226
|
+
* Collects the last value emitted by a source.
|
|
227
|
+
* This is a terminal operator that returns the last emitted value.
|
|
228
|
+
* Rejects if the source completes without emitting any values.
|
|
229
|
+
* @param source - The source to collect from.
|
|
230
|
+
* @returns A promise that resolves with the last emitted value.
|
|
231
|
+
*/
|
|
232
|
+
declare const collect: <T>(source: Source<T>) => Promise<T>;
|
|
233
|
+
//#endregion
|
|
234
|
+
//#region src/stream/sinks/collect-all.d.ts
|
|
235
|
+
/**
|
|
236
|
+
* Collects all values from a source into an array.
|
|
237
|
+
* This is a terminal operator that accumulates all emitted values.
|
|
238
|
+
* @param source - The source to collect values from.
|
|
239
|
+
* @returns A promise that resolves with an array of all emitted values.
|
|
240
|
+
*/
|
|
241
|
+
declare const collectAll: <T>(source: Source<T>) => Promise<T[]>;
|
|
242
|
+
//#endregion
|
|
243
|
+
//#region src/stream/sinks/peek.d.ts
|
|
244
|
+
/**
|
|
245
|
+
* Synchronously reads the first value from a source and immediately unsubscribes.
|
|
246
|
+
* This is useful for reading the current state without maintaining a long-lived subscription.
|
|
247
|
+
* Throws if the source does not emit a value synchronously.
|
|
248
|
+
* @param source - The source to peek from.
|
|
249
|
+
* @returns The first value emitted by the source.
|
|
250
|
+
*/
|
|
251
|
+
declare const peek: <T>(source: Source<T>) => T;
|
|
252
|
+
//#endregion
|
|
253
|
+
//#region src/stream/operators/map.d.ts
|
|
254
|
+
/**
|
|
255
|
+
* Maps each value from the source through a transformation function.
|
|
256
|
+
* @param fn - The transformation function.
|
|
257
|
+
* @returns An operator that maps values.
|
|
258
|
+
*/
|
|
259
|
+
declare const map: <A, B>(fn: (value: A) => B) => Operator<A, B>;
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/stream/operators/filter.d.ts
|
|
262
|
+
/**
|
|
263
|
+
*
|
|
264
|
+
* @param predicate - The predicate function.
|
|
265
|
+
* @returns An operator that filters values.
|
|
266
|
+
*/
|
|
267
|
+
declare function filter<T, S extends T>(predicate: (value: T) => value is S): Operator<T, S>;
|
|
268
|
+
declare function filter<T>(predicate: (value: T) => boolean): Operator<T>;
|
|
269
|
+
//#endregion
|
|
270
|
+
//#region src/stream/operators/take.d.ts
|
|
271
|
+
/**
|
|
272
|
+
* Takes only the first N values from the source and completes.
|
|
273
|
+
* @param count - The number of values to take.
|
|
274
|
+
* @returns An operator that takes values.
|
|
275
|
+
*/
|
|
276
|
+
declare const take: <T>(count: number) => Operator<T>;
|
|
277
|
+
//#endregion
|
|
278
|
+
//#region src/stream/operators/take-until.d.ts
|
|
279
|
+
/**
|
|
280
|
+
* Emits values from the source until the notifier source emits a value.
|
|
281
|
+
* When the notifier emits, the source is cancelled and completes immediately.
|
|
282
|
+
* @param notifier - Source that signals when to complete.
|
|
283
|
+
* @returns Operator that completes when notifier emits.
|
|
284
|
+
*/
|
|
285
|
+
declare const takeUntil: <T>(notifier: Source<unknown>) => Operator<T>;
|
|
286
|
+
//#endregion
|
|
287
|
+
//#region src/stream/operators/share.d.ts
|
|
288
|
+
/**
|
|
289
|
+
* Shares a single source across multiple subscribers (multicast).
|
|
290
|
+
* The source is only executed once, and all subscribers receive the same values.
|
|
291
|
+
* This is essential for deduplication and caching scenarios.
|
|
292
|
+
* @returns An operator that shares the source.
|
|
293
|
+
*/
|
|
294
|
+
declare const share: <T>() => Operator<T>;
|
|
295
|
+
//#endregion
|
|
296
|
+
//#region src/stream/operators/merge.d.ts
|
|
297
|
+
/**
|
|
298
|
+
* Merges multiple sources into a single source.
|
|
299
|
+
* Values are emitted as soon as they arrive from any source.
|
|
300
|
+
* Completes when all sources complete.
|
|
301
|
+
* @param sources - The sources to merge.
|
|
302
|
+
* @returns A merged source.
|
|
303
|
+
*/
|
|
304
|
+
declare const merge: <T extends readonly Source<unknown>[]>(...sources: T) => Source<T[number] extends Source<infer U> ? U : never>;
|
|
305
|
+
//#endregion
|
|
306
|
+
//#region src/stream/operators/merge-map.d.ts
|
|
307
|
+
/**
|
|
308
|
+
* Maps each value to a source and flattens all sources into a single output source.
|
|
309
|
+
* Similar to flatMap. Values from all inner sources are merged concurrently.
|
|
310
|
+
* @param fn - Function that returns a source for each value.
|
|
311
|
+
* @returns An operator that flattens mapped sources.
|
|
312
|
+
*/
|
|
313
|
+
declare const mergeMap: <A, B>(fn: (value: A) => Source<B>) => Operator<A, B>;
|
|
314
|
+
//#endregion
|
|
315
|
+
//#region src/stream/operators/switch-map.d.ts
|
|
316
|
+
declare const switchMap: <A, B>(fn: (value: A) => Source<B>) => Operator<A, B>;
|
|
317
|
+
//#endregion
|
|
318
|
+
//#region src/stream/operators/tap.d.ts
|
|
319
|
+
/**
|
|
320
|
+
* Executes a side effect for each value without modifying the stream.
|
|
321
|
+
* Useful for debugging, logging, or triggering side effects.
|
|
322
|
+
* @param fn - The side effect function.
|
|
323
|
+
* @returns An operator that taps into the stream.
|
|
324
|
+
*/
|
|
325
|
+
declare const tap: <T>(fn: (value: T) => void) => Operator<T>;
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/stream/operators/initialize.d.ts
|
|
328
|
+
/**
|
|
329
|
+
* Executes a side effect when the source is initialized (being subscribed to).
|
|
330
|
+
* @param fn - The side effect function.
|
|
331
|
+
* @returns An operator that executes the side effect when the source is initialized.
|
|
332
|
+
*/
|
|
333
|
+
declare const initialize: <T>(fn: () => void) => Operator<T>;
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/stream/operators/finalize.d.ts
|
|
336
|
+
/**
|
|
337
|
+
* Executes a side effect when the source terminates (completes or unsubscribes).
|
|
338
|
+
* @param fn - The side effect function.
|
|
339
|
+
* @returns An operator that executes the side effect when the source terminates.
|
|
340
|
+
*/
|
|
341
|
+
declare const finalize: <T>(fn: () => void) => Operator<T>;
|
|
342
|
+
//#endregion
|
|
343
|
+
//#region src/stream/sources/from-value.d.ts
|
|
344
|
+
/**
|
|
345
|
+
* Creates a source that emits a single value and completes.
|
|
346
|
+
* @param value - The value to emit.
|
|
347
|
+
* @returns A source containing the single value.
|
|
348
|
+
*/
|
|
349
|
+
declare const fromValue: <T>(value: T) => Source<T>;
|
|
350
|
+
//#endregion
|
|
351
|
+
//#region src/stream/sources/from-array.d.ts
|
|
352
|
+
/**
|
|
353
|
+
* Creates a source that emits values from an array and completes.
|
|
354
|
+
* @param values - The array of values to emit.
|
|
355
|
+
* @returns A source containing the array values.
|
|
356
|
+
*/
|
|
357
|
+
declare const fromArray: <T>(values: T[]) => Source<T>;
|
|
358
|
+
//#endregion
|
|
359
|
+
//#region src/stream/sources/make-subject.d.ts
|
|
360
|
+
/**
|
|
361
|
+
* Subject is both a Source and an imperative push API.
|
|
362
|
+
*/
|
|
363
|
+
type Subject<T> = {
|
|
364
|
+
/**
|
|
365
|
+
* The source that can be subscribed to.
|
|
366
|
+
*/
|
|
367
|
+
source: Source<T>;
|
|
368
|
+
/**
|
|
369
|
+
* Push a value to all subscribers.
|
|
370
|
+
* @param value - The value to push.
|
|
371
|
+
*/
|
|
372
|
+
next: (value: T) => void;
|
|
373
|
+
/**
|
|
374
|
+
* Complete all subscribers.
|
|
375
|
+
*/
|
|
376
|
+
complete: () => void;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Creates a new Subject which can be used as an IO event hub.
|
|
380
|
+
* @returns A new Subject.
|
|
381
|
+
*/
|
|
382
|
+
declare const makeSubject: <T>() => Subject<T>;
|
|
383
|
+
//#endregion
|
|
384
|
+
//#region src/stream/sources/from-subscription.d.ts
|
|
385
|
+
declare const fromSubscription: <T>(pull: () => T, poke: (signal: () => void) => () => void) => Source<T>;
|
|
386
|
+
//#endregion
|
|
387
|
+
//#region src/stream/sources/from-promise.d.ts
|
|
388
|
+
declare const fromPromise: <T>(promise: Promise<T>) => Source<T>;
|
|
389
|
+
//#endregion
|
|
390
|
+
//#region src/stream/sources/make.d.ts
|
|
391
|
+
/**
|
|
392
|
+
* Creates a new Source from scratch from a passed subscriber function.
|
|
393
|
+
*
|
|
394
|
+
* The subscriber function receives an observer with next and complete callbacks.
|
|
395
|
+
* It must return a teardown function which is called when the source is cancelled.
|
|
396
|
+
* @internal
|
|
397
|
+
* @param subscriber - A callback that is called when the Source is subscribed to.
|
|
398
|
+
* @returns A Source created from the subscriber parameter.
|
|
399
|
+
*/
|
|
400
|
+
declare const make: <T>(subscriber: (observer: {
|
|
401
|
+
next: (value: T) => void;
|
|
402
|
+
complete: () => void;
|
|
403
|
+
}) => () => void) => Source<T>;
|
|
404
|
+
//#endregion
|
|
405
|
+
export { Subscription as A, Observer as C, Operator as D, pipe as E, Sink as O, publish as S, compose as T, filter as _, makeSubject as a, collectAll as b, finalize as c, switchMap as d, mergeMap as f, take as g, takeUntil as h, Subject as i, Source as k, initialize as l, share as m, fromPromise as n, fromArray as o, merge as p, fromSubscription as r, fromValue as s, make as t, tap as u, map as v, subscribe as w, collect as x, peek as y };
|