UNPKG

1.28 kBTypeScriptView Raw
1import { MonoTypeOperatorFunction, ObservableInput } from '../types';
2/**
3 * The {@link retry} operator configuration object. `retry` either accepts a `number`
4 * or an object described by this interface.
5 */
6export interface RetryConfig {
7 /**
8 * The maximum number of times to retry. If `count` is omitted, `retry` will try to
9 * resubscribe on errors infinite number of times.
10 */
11 count?: number;
12 /**
13 * The number of milliseconds to delay before retrying, OR a function to
14 * return a notifier for delaying. If a function is given, that function should
15 * return a notifier that, when it emits will retry the source. If the notifier
16 * completes _without_ emitting, the resulting observable will complete without error,
17 * if the notifier errors, the error will be pushed to the result.
18 */
19 delay?: number | ((error: any, retryCount: number) => ObservableInput<any>);
20 /**
21 * Whether or not to reset the retry counter when the retried subscription
22 * emits its first value.
23 */
24 resetOnSuccess?: boolean;
25}
26export declare function retry<T>(count?: number): MonoTypeOperatorFunction<T>;
27export declare function retry<T>(config: RetryConfig): MonoTypeOperatorFunction<T>;
28//# sourceMappingURL=retry.d.ts.map
\No newline at end of file