ofAsync

Namespace: FsToolkit.ErrorHandling

Transforms a Async<'T> into an Async<Result<'T, 'Error>>.

Function Signature

Async<'T> -> Async<Result<'T, 'Error>>

Examples

Example 1

let result = AsyncResult.ofAsync (async { return 42 })
// async { return Ok 42 }

Last updated