es-promise-ext
Version:
Native promise extensions for javascript and typescript.
18 lines (17 loc) • 396 B
TypeScript
type RejectFunction = () => Promise<never>;
/**
* Reject with error in the promise chain.
*
* @param {any} reason
* - the reason of the error
*
* @return {RejectFunction}
* The error which throw in the promise
*
* @example
* Promise.resolve()
* .then(reject('a'))
* .catch(error => console.error(error))
*/
export default function reject(reason: any): RejectFunction;
export {};