-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
3,382 additions
and
821 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Creates a new instance | ||
* @param {object} options An options object | ||
* @param {() => Promise} options.fn A promise | ||
* @param {number} options.interval Time in ms representing the time span between the promise resolving and the next one firing | ||
* @param {number} options.timeout The maximum amount of time in ms which the promise is allowed to take | ||
* @param {(value: any) => any} options.onSuccess The success callback | ||
* @param {(reason: any) => any} options.onError The error callback | ||
* | ||
* @returns {{start: () => void, stop: () => void}} | ||
*/ | ||
export default function _default({ fn, interval, timeout, onSuccess, onError }: { | ||
fn: () => Promise<any>; | ||
interval: number; | ||
timeout: number; | ||
onSuccess: (value: any) => any; | ||
onError: (reason: any) => any; | ||
}): { | ||
start: () => void; | ||
stop: () => void; | ||
}; |
Oops, something went wrong.