Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/rimbu/core/main/exports.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.13.5/core/main/exports.ts";

A potentially lazy value of type T.

definition: T | (() => T)
function OptLazy
Re-export
import { OptLazy } from "https://deno.land/x/rimbu@0.13.5/core/main/exports.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