1 import { MonoTypeOperatorFunction } from '../types';
3 * Returns an Observable that mirrors the source Observable with the exception of an `error`. If the source Observable
4 * calls `error`, this method will resubscribe to the source Observable for a maximum of `count` resubscriptions (given
5 * as a number parameter) rather than propagating the `error` call.
9 * Any and all items emitted by the source Observable will be emitted by the resulting Observable, even those emitted
10 * during failed subscriptions. For example, if an Observable fails at first but emits [1, 2] then succeeds the second
11 * time and emits: [1, 2, 3, 4, 5] then the complete stream of emissions and notifications
12 * would be: [1, 2, 1, 2, 3, 4, 5, `complete`].
16 * import { interval, of, throwError } from 'rxjs';
17 * import { mergeMap, retry } from 'rxjs/operators';
19 * const source = interval(1000);
20 * const example = source.pipe(
23 * return throwError('Error!');
27 * //retry 2 times on error
31 * const subscribe = example.subscribe({
32 * next: val => console.log(val),
33 * error: val => console.log(`${val}: Retried 2 times then quit!`)
37 * // 0..1..2..3..4..5..
38 * // 0..1..2..3..4..5..
39 * // 0..1..2..3..4..5..
40 * // "Error!: Retried 2 times then quit!"
43 * @param {number} count - Number of retry attempts before failing.
44 * @return {Observable} The source Observable modified with the retry logic.
48 export declare function retry<T>(count?: number): MonoTypeOperatorFunction<T>;