forked from AubaidFarrukh/smart-retry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
29 lines (24 loc) · 724 Bytes
/
Copy pathindex.ts
File metadata and controls
29 lines (24 loc) · 724 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** @format */
export { RetryManager } from './retryManager';
export { FileStore } from './fileStore';
export * from './types';
export * from './utils';
export * from './integrations';
import { RetryManager } from './retryManager';
import { RetryConfig, RetryableFunction, RetryResult } from './types';
export function smartRetry<T>(
fn: RetryableFunction<T>,
config?: RetryConfig
): Promise<RetryResult<T>> {
const manager = new RetryManager(config);
return manager.execute(fn);
}
export function createRetryManager(config?: RetryConfig, storePath?: string): RetryManager {
return new RetryManager(config, storePath);
}
export default {
RetryManager,
smartRetry,
createRetryManager,
};
// test comment