Documentation / zerotal / helpers / tapAsync
Function: tapAsync()
tapAsync<
T>(value,callback):Promise<T>
Defined in: packages/core/src/helpers/index.ts:162
Async version of tap. Awaits the callback then returns the original value.
Type Parameters
T
T
Parameters
value
T
callback
(val) => Promise<void>
Returns
Promise<T>
Example
return await tapAsync(await User.create(data), async (user) => {
await Notification.send(user, new WelcomeEmail());
});