source: trip-planner-front/node_modules/rxjs/src/internal/operators/endWith.ts@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 4.1 KB
Line 
1import { Observable } from '../Observable';
2import { concat } from '../observable/concat';
3import { of } from '../observable/of';
4import { MonoTypeOperatorFunction, SchedulerLike, OperatorFunction } from '../types';
5
6/* tslint:disable:max-line-length */
7/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
8export function endWith<T>(scheduler: SchedulerLike): MonoTypeOperatorFunction<T>;
9/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
10export function endWith<T, A>(v1: A, scheduler: SchedulerLike): OperatorFunction<T, T | A>;
11/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
12export function endWith<T, A, B>(v1: A, v2: B, scheduler: SchedulerLike): OperatorFunction<T, T | A | B>;
13/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
14export function endWith<T, A, B, C>(v1: A, v2: B, v3: C, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C>;
15/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
16export function endWith<T, A, B, C, D>(v1: A, v2: B, v3: C, v4: D, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D>;
17/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
18export function endWith<T, A, B, C, D, E>(v1: A, v2: B, v3: C, v4: D, v5: E, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D | E>;
19/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
20export function endWith<T, A, B, C, D, E, F>(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F, scheduler: SchedulerLike): OperatorFunction<T, T | A | B | C | D | E | F>;
21
22export function endWith<T, A>(v1: A): OperatorFunction<T, T | A>;
23export function endWith<T, A, B>(v1: A, v2: B): OperatorFunction<T, T | A | B>;
24export function endWith<T, A, B, C>(v1: A, v2: B, v3: C): OperatorFunction<T, T | A | B | C>;
25export function endWith<T, A, B, C, D>(v1: A, v2: B, v3: C, v4: D): OperatorFunction<T, T | A | B | C | D>;
26export function endWith<T, A, B, C, D, E>(v1: A, v2: B, v3: C, v4: D, v5: E): OperatorFunction<T, T | A | B | C | D | E>;
27export function endWith<T, A, B, C, D, E, F>(v1: A, v2: B, v3: C, v4: D, v5: E, v6: F): OperatorFunction<T, T | A | B | C | D | E | F>;
28export function endWith<T, Z = T>(...array: Z[]): OperatorFunction<T, T | Z>;
29/** @deprecated use {@link scheduled} and {@link concatAll} (e.g. `scheduled([source, [a, b, c]], scheduler).pipe(concatAll())`) */
30export function endWith<T, Z = T>(...array: Array<Z | SchedulerLike>): OperatorFunction<T, T | Z>;
31/* tslint:enable:max-line-length */
32
33/**
34 * Returns an Observable that emits the items you specify as arguments after it finishes emitting
35 * items emitted by the source Observable.
36 *
37 * ![](endWith.png)
38 *
39 * ## Example
40 * ### After the source observable completes, appends an emission and then completes too.
41 *
42 * ```ts
43 * import { of } from 'rxjs';
44 * import { endWith } from 'rxjs/operators';
45 *
46 * of('hi', 'how are you?', 'sorry, I have to go now').pipe(
47 * endWith('goodbye!'),
48 * )
49 * .subscribe(word => console.log(word));
50 * // result:
51 * // 'hi'
52 * // 'how are you?'
53 * // 'sorry, I have to go now'
54 * // 'goodbye!'
55 * ```
56 *
57 * @param {...T} values - Items you want the modified Observable to emit last.
58 * @param {SchedulerLike} [scheduler] - A {@link SchedulerLike} to use for scheduling
59 * the emissions of the `next` notifications.
60 * @return {Observable} An Observable that emits the items emitted by the source Observable
61 * and then emits the items in the specified Iterable.
62 * @method endWith
63 * @owner Observable
64 */
65export function endWith<T>(...array: Array<T | SchedulerLike>): MonoTypeOperatorFunction<T> {
66 return (source: Observable<T>) => concat(source, of(...array)) as Observable<T>;
67}
Note: See TracBrowser for help on using the repository browser.