import { type OptLazyOr } from "https://deno.land/x/rimbu@0.13.1/core/main/index.ts";
A potentially lazy value that, in case of a lazy function, received a default value that it can return.
import { OptLazyOr } from "https://deno.land/x/rimbu@0.13.1/core/main/index.ts";
Returns the value contained in an OptLazyOr
instance of type T, or the given
otherValue
if the lazy function returns it.
Examples
Example 1
Example 1
OptLazyOr(1, 'a') // => 1
OptLazyOr(() => 1, 'a') // => 1
OptLazyOr((none) => none, 'a') // => 'a'