hd-utils
Version:
A handy utils for modern JS developers
11 lines (10 loc) • 509 B
TypeScript
import { AttemptOptions } from "../types";
/**
* @description Attempts to invoke `func` async, returning either the result or will adjust to the options,
* if nothing was passed to the options, it will return nothing
*
* @example await attemptAsync(selector =>
* document.querySelectorAll(selector),{errorHander:(e)=> console.error(e)}, '>_>')
*/
declare function attemptAsync<T = any>(func: (...args: any[]) => T, options?: AttemptOptions, ...args: any[]): Promise<any>;
export default attemptAsync;