Tap into a promise chain without affecting its value or state
npm install promise-tap-then-catchTap a promise chain without affecting its value or state
``bash`
yarn add promise-tap-then-catch
yarn-tool add promise-tap-then-catch
yt add promise-tap-then-catch
` , V extends any = Awaited >(promise: P, export declare type Constructor /** , E extends any = unknown, EC extends Constructor export declare function promiseTapThenCatch , V extends any = Awaited , E extends any = unknown>(promise: P, export declare function promiseTapLazyBoth , V extends any = Awaited , E extends any = unknown>(promise: P, export default promiseTapLazyBoth;typescript``
/**
* Essentially like .then(), except that the value passed in is the value returned.
* @see http://bluebirdjs.com/docs/api/tap.html
*/
export declare function promiseTapThen
handler: (value: V, ...argv: any[]) => any
): P;
export declare type ITapCatchArgvs
...EC[],
(reason: EC, ...argv: any[]) => any
];
* .tapCatch is a convenience method for reacting to errors without handling them with promises - similar to finally but only called on rejections. Useful for logging errors.
* @see http://bluebirdjs.com/docs/api/tapCatch.html
*/
export declare function promiseTapCatch
...inputs: ITapCatchArgvs
((reason: E, ...argv: any[]) => any)
]
): P;
handlerThen: (value: V, ...argv: any[]) => any,
handlerCatch?: (reason: E, ...argv: any[]) => any
): P;
handlerThen: (value: V, ...argv: any[]) => any,
handlerCatch?: (reason: E, ...argv: any[]) => any
): P;