aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/operators/finalize.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/operators/finalize.ts
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/operators/finalize.ts')
-rw-r--r--node_modules/rxjs/src/internal/operators/finalize.ts75
1 files changed, 0 insertions, 75 deletions
diff --git a/node_modules/rxjs/src/internal/operators/finalize.ts b/node_modules/rxjs/src/internal/operators/finalize.ts
deleted file mode 100644
index 12821fd..0000000
--- a/node_modules/rxjs/src/internal/operators/finalize.ts
+++ /dev/null
@@ -1,75 +0,0 @@
-import { MonoTypeOperatorFunction } from '../types';
-import { operate } from '../util/lift';
-
-/**
- * Returns an Observable that mirrors the source Observable, but will call a specified function when
- * the source terminates on complete or error.
- * The specified function will also be called when the subscriber explicitly unsubscribes.
- *
- * ## Examples
- *
- * Execute callback function when the observable completes
- *
- * ```ts
- * import { interval, take, finalize } from 'rxjs';
- *
- * // emit value in sequence every 1 second
- * const source = interval(1000);
- * const example = source.pipe(
- * take(5), //take only the first 5 values
- * finalize(() => console.log('Sequence complete')) // Execute when the observable completes
- * );
- * const subscribe = example.subscribe(val => console.log(val));
- *
- * // results:
- * // 0
- * // 1
- * // 2
- * // 3
- * // 4
- * // 'Sequence complete'
- * ```
- *
- * Execute callback function when the subscriber explicitly unsubscribes
- *
- * ```ts
- * import { interval, finalize, tap, noop, timer } from 'rxjs';
- *
- * const source = interval(100).pipe(
- * finalize(() => console.log('[finalize] Called')),
- * tap({
- * next: () => console.log('[next] Called'),
- * error: () => console.log('[error] Not called'),
- * complete: () => console.log('[tap complete] Not called')
- * })
- * );
- *
- * const sub = source.subscribe({
- * next: x => console.log(x),
- * error: noop,
- * complete: () => console.log('[complete] Not called')
- * });
- *
- * timer(150).subscribe(() => sub.unsubscribe());
- *
- * // results:
- * // '[next] Called'
- * // 0
- * // '[finalize] Called'
- * ```
- *
- * @param callback Function to be called when source terminates.
- * @return A function that returns an Observable that mirrors the source, but
- * will call the specified function on termination.
- */
-export function finalize<T>(callback: () => void): MonoTypeOperatorFunction<T> {
- return operate((source, subscriber) => {
- // TODO: This try/finally was only added for `useDeprecatedSynchronousErrorHandling`.
- // REMOVE THIS WHEN THAT HOT GARBAGE IS REMOVED IN V8.
- try {
- source.subscribe(subscriber);
- } finally {
- subscriber.add(callback);
- }
- });
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage