Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / helpers / tapAsync

Function: tapAsync()

tapAsync<T>(value, callback): Promise<T>

Defined in: 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());
});