fx-flow v0.7.0 / flow / inject
Function: inject()
inject(fn, result)
inject<
A
>(fn
,result
):Promise
<Result
<A
>>
Inject a function to the progress without side effect.
Type parameters
• A
Parameters
• fn
• result: Result
<A
>
Returns
Promise
<Result
<A
>>
Example
typescript
// with flow
const userInfo = (await flow(ok(userId), inject(doSometingElse), andThen(queryUserInfo), errThen(notify))).unwrapOr(defaultUserInfo)
Source
packages/core/src/flow/inject.ts:17
inject(fn)
inject<
A
>(fn
): (result
) =>Promise
<Result
<A
>>
Type parameters
• A
Parameters
• fn
Returns
Function
Parameters
• result: Result
<A
>
Returns
Promise
<Result
<A
>>
Source
packages/core/src/flow/inject.ts:21
inject(fn, result)
inject<
A
>(fn
,result
):Result
<A
>
Type parameters
• A
Parameters
• fn
• result: Result
<A
>
Returns
Result
<A
>
Source
packages/core/src/flow/inject.ts:24
inject(fn)
inject<
A
>(fn
): (result
) =>Result
<A
>
Type parameters
• A
Parameters
• fn
Returns
Function
Parameters
• result: Result
<A
>
Returns
Result
<A
>