rx-retry
Version:
Package for retries in RxJS, Promises and NestJS
22 lines • 1.17 kB
TypeScript
import type { Observable } from 'rxjs';
import { ResolveRetryConfig } from '../models';
import type { RetryBackoffConfig } from '../models';
import type { PartialDeep } from '../models/deep-partial.model';
export declare class RxRetryService {
private readonly mainConfig;
constructor(mainConfig: ResolveRetryConfig);
/**
* Resolve promise with exponential backoff retry. Read documetation for more info.
* @param promise - Promise to resolve
* @param config - Override the main config - only selected fields
* @returns Resolved value of the promise with type T (Generic)
*/
resolveWithRetry<T = any>(promise: Promise<any> | Observable<any>, config?: PartialDeep<ResolveRetryConfig>): Promise<T>;
/**
* An operator in a pipe that retries an Observable with exponential backoff. Read documetation for more info.
* Will look only for the retryStrategy in the main config.
* @param config - Override the main config - only selected fields
*/
resolveWithRetryOperator(config?: Partial<RetryBackoffConfig>): <T>(source: Observable<T>) => Observable<T>;
}
//# sourceMappingURL=rx-retry.service.d.ts.map