fx-flow v0.7.0 / flow / tryDo
Function: tryDo()
tryDo<
A
>(fn
):TryDoResult
<A
>
Convert the result of fn
to Result
. Automatically catch error.
Type parameters
• A
Parameters
• fn
Returns
TryDoResult
<A
>
Example
typescript
const obj = {}
tryDo(() => obj.a.b) // get a failure Result