method
$.ShellPromise.try
fn: (...args: A) => T | PromiseLike<T>,
...args: A
): Promise<T>;
Run a function and return a promise of its result. If the function throws, the returned promise rejects with the thrown error.
@param fn
The function to run
@param args
The arguments to pass to the function. This is similar to setTimeout and avoids the extra closure.
@returns
A promise that resolves with the function's result