Package: effect
Module: Option
Replaces the value inside a Some with void (undefined), leaving None
unchanged.
When to use
Use when you need to discard a present Option value while preserving
whether it was Some or None.
Example (Voiding the value)
import { Option } from "effect"
console.log(Option.asVoid(Option.some(42)))
// Output: { _id: 'Option', _tag: 'Some', value: undefined }
console.log(Option.asVoid(Option.none()))
// Output: { _id: 'Option', _tag: 'None' }
See
as to replace with a specific constantSignature
declare const asVoid: <_>(self: Option<_>) => Option<void>
Since v2.0.0