Skip to content

Commit

Permalink
Published 2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Gates-Idem committed Feb 13, 2018
1 parent 9c7834c commit 5468970
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "@lifeomic/attempt",
"version": "2.0.1",
"version": "2.0.2",
"description": "Library that can be used to retry functions that return promise",
"main": "./work/dist/src/",
"module": "./work/dist/es6/src/",
Expand Down
3 changes: 2 additions & 1 deletion src/index.ts
Expand Up @@ -5,6 +5,7 @@ export interface AttemptContext {
abort: () => void;
}

export type AttemptFunction = (context: AttemptContext, options: AttemptOptions) => Promise<any>;
export type BeforeAttempt = (context: AttemptContext, options: AttemptOptions) => void;
export type CalculateDelay = (context: AttemptContext, options: AttemptOptions) => number;
export type HandleError = (err: any, context: AttemptContext, options: AttemptOptions) => void;
Expand Down Expand Up @@ -86,7 +87,7 @@ export function defaultCalculateDelay (context: AttemptContext, options: Attempt
}

export async function retry (
attemptFunc: (context: AttemptContext, options: AttemptOptions) => Promise<any>,
attemptFunc: AttemptFunction,
attemptOptions?: PartialAttemptOptions) {

const options = applyDefaults(attemptOptions);
Expand Down

0 comments on commit 5468970

Please sign in to comment.