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