ignore

AsyncResultOption.ignore

Namespace: FsToolkit.ErrorHandling

Function Signature:

Async<Result<'a option, 'b>> -> Async<Result<unit option, 'b>>

This is a shortcut for AsyncResultOption.map ignore.

Examples

Example 1

let deletePostIfExists : DeletePostRequest -> Async<Result<Post option, exn>>

We can call this with the do! syntax inside a computation expression using AsyncResultOption.ignore as below:

let deletePost = asyncResultOption {
  do! deletePostIfExists deletePostRequest |> AsyncResultOption.ignore
}

Last updated