import { type OptLazyOr } from "https://deno.land/x/rimbu@1.2.0/core/mod.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@1.2.0/core/mod.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'