diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
| commit | d55b767039605256c736166a942a9138e3eacfd7 (patch) | |
| tree | 947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/operators/isEmpty.ts | |
| parent | 864ce67d89c77d8ef9c3361f80d619853abcf91c (diff) | |
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/operators/isEmpty.ts')
| -rw-r--r-- | node_modules/rxjs/src/internal/operators/isEmpty.ts | 82 |
1 files changed, 0 insertions, 82 deletions
diff --git a/node_modules/rxjs/src/internal/operators/isEmpty.ts b/node_modules/rxjs/src/internal/operators/isEmpty.ts deleted file mode 100644 index 5de8deb..0000000 --- a/node_modules/rxjs/src/internal/operators/isEmpty.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { OperatorFunction } from '../types'; -import { operate } from '../util/lift'; -import { createOperatorSubscriber } from './OperatorSubscriber'; - -/** - * Emits `false` if the input Observable emits any values, or emits `true` if the - * input Observable completes without emitting any values. - * - * <span class="informal">Tells whether any values are emitted by an Observable.</span> - * - *  - * - * `isEmpty` transforms an Observable that emits values into an Observable that - * emits a single boolean value representing whether or not any values were - * emitted by the source Observable. As soon as the source Observable emits a - * value, `isEmpty` will emit a `false` and complete. If the source Observable - * completes having not emitted anything, `isEmpty` will emit a `true` and - * complete. - * - * A similar effect could be achieved with {@link count}, but `isEmpty` can emit - * a `false` value sooner. - * - * ## Examples - * - * Emit `false` for a non-empty Observable - * - * ```ts - * import { Subject, isEmpty } from 'rxjs'; - * - * const source = new Subject<string>(); - * const result = source.pipe(isEmpty()); - * - * source.subscribe(x => console.log(x)); - * result.subscribe(x => console.log(x)); - * - * source.next('a'); - * source.next('b'); - * source.next('c'); - * source.complete(); - * - * // Outputs - * // 'a' - * // false - * // 'b' - * // 'c' - * ``` - * - * Emit `true` for an empty Observable - * - * ```ts - * import { EMPTY, isEmpty } from 'rxjs'; - * - * const result = EMPTY.pipe(isEmpty()); - * result.subscribe(x => console.log(x)); - * - * // Outputs - * // true - * ``` - * - * @see {@link count} - * @see {@link EMPTY} - * - * @return A function that returns an Observable that emits boolean value - * indicating whether the source Observable was empty or not. - */ -export function isEmpty<T>(): OperatorFunction<T, boolean> { - return operate((source, subscriber) => { - source.subscribe( - createOperatorSubscriber( - subscriber, - () => { - subscriber.next(false); - subscriber.complete(); - }, - () => { - subscriber.next(true); - subscriber.complete(); - } - ) - ); - }); -} |
