API reference / @backpack/error-handling / promises / onSuccess
Function: onSuccess()
ts
function onSuccess<T>(consumer): (value) => T;
Executes the given callback if successful, letting the original value pass through.
Can be applied on .then()
method of a Promise
to introduce a side effect.
Type Parameters
Type Parameter |
---|
T |
Parameters
Parameter | Type |
---|---|
consumer | (value ) => void |
Returns
ts
(value): T;
Parameters
Parameter | Type |
---|---|
value | T |
Returns
T