Skip to content

evaluate

evaluate<T>(maybeEvaluate): T

Takes a value or a function that returns a value, and returns the value.

Example

evaluate("foobar")
// => "foobar"
evaluate(() => "foobar"))
// => "foobar"

Type Parameters

T

The element type.

Parameters

maybeEvaluate

The value to evaluate

T | () => T

Returns

T

A function that takes a value of type T or a function that returns a value of type T and returns a value of type T.