Skip to main content
Module

x/rimbu/mod.ts>OptLazy

Rimbu is a TypeScript library focused on immutable, performant, and type-safe collections and other tools.
Go to Latest
type alias OptLazy
Re-export
import { type OptLazy } from "https://deno.land/x/rimbu@0.14.0/mod.ts";

A potentially lazy value of type T.

definition: T | (() => T)
function OptLazy
Re-export
import { OptLazy } from "https://deno.land/x/rimbu@0.14.0/mod.ts";

Returns the value contained in an OptLazy instance of type T.

Examples

Example 1

OptLazy(1)              // => 1
OptLazy(() => 1)        // => 1
OptLazy(() => () => 1)  // => () => 1

Parameters

optLazy: OptLazy<T>
  • the OptLazy value of type T