Module: Side Effects
Functions
inject
▸ inject<Function
>(effect
): (fn
: Function
) => Function
Injects a function with a side effect. Returns the copy of the original function.
Type parameters
Name | Type |
---|---|
Function | extends VariadicFunction |
Parameters
Name | Type |
---|---|
effect | Effect <Function > |
Returns
fn
▸ (fn
): Function
Parameters
Name | Type |
---|---|
fn | Function |
Returns
Function
▸ inject<Function
>(fn
, effect
): Function
Injects a function with a side effect. Returns the copy of the original function.
Type parameters
Name | Type |
---|---|
Function | extends VariadicFunction |
Parameters
Name | Type |
---|---|
fn | Function |
effect | Effect <Function > |
Returns
Function
rethrow
▸ rethrow<Error
>(effect?
): (error
: Error
) => never
Rethrows a received error performing an optional side effect.
Type parameters
Name |
---|
Error |
Parameters
Name | Type |
---|---|
effect? | Effect <(error : Error ) => never > |
Returns
fn
▸ (error
): never
Parameters
Name | Type |
---|---|
error | Error |
Returns
never
tap
▸ tap<Value
>(effect
): Identity
<Value
>
Performs a side effect passing the received argument through itself.
Type parameters
Name |
---|
Value |
Parameters
Name | Type |
---|---|
effect | Effect <Map <Value , any >> |
Returns
Identity
<Value
>