aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/observable/never.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-28 17:26:46 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-28 17:43:56 -0700
commite4fa1e69e7ebfb627c7198fd1a9881e9327ec4d4 (patch)
tree06284a538a6008eca75051399e47db4e5d50301c /node_modules/rxjs/src/internal/observable/never.ts
initial commit: scaffolding
Diffstat (limited to 'node_modules/rxjs/src/internal/observable/never.ts')
-rw-r--r--node_modules/rxjs/src/internal/observable/never.ts44
1 files changed, 44 insertions, 0 deletions
diff --git a/node_modules/rxjs/src/internal/observable/never.ts b/node_modules/rxjs/src/internal/observable/never.ts
new file mode 100644
index 0000000..cfbec7d
--- /dev/null
+++ b/node_modules/rxjs/src/internal/observable/never.ts
@@ -0,0 +1,44 @@
+import { Observable } from '../Observable';
+import { noop } from '../util/noop';
+
+/**
+ * An Observable that emits no items to the Observer and never completes.
+ *
+ * ![](never.png)
+ *
+ * A simple Observable that emits neither values nor errors nor the completion
+ * notification. It can be used for testing purposes or for composing with other
+ * Observables. Please note that by never emitting a complete notification, this
+ * Observable keeps the subscription from being disposed automatically.
+ * Subscriptions need to be manually disposed.
+ *
+ * ## Example
+ *
+ * Emit the number 7, then never emit anything else (not even complete)
+ *
+ * ```ts
+ * import { NEVER, startWith } from 'rxjs';
+ *
+ * const info = () => console.log('Will not be called');
+ *
+ * const result = NEVER.pipe(startWith(7));
+ * result.subscribe({
+ * next: x => console.log(x),
+ * error: info,
+ * complete: info
+ * });
+ * ```
+ *
+ * @see {@link Observable}
+ * @see {@link EMPTY}
+ * @see {@link of}
+ * @see {@link throwError}
+ */
+export const NEVER = new Observable<never>(noop);
+
+/**
+ * @deprecated Replaced with the {@link NEVER} constant. Will be removed in v8.
+ */
+export function never() {
+ return NEVER;
+}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage