API reference@evolu/common › Function

Function utilities including exhaustive checks and composition.

Functions

FunctionDescription
constantCreates a Thunk that always returns a precomputed value.
disposableCreates an object that follows JavaScript disposal semantics.
exhaustiveCheckHelper function to ensure exhaustive matching in a switch statement. Throws an error if an unhandled case is encountered.
identityReturns the value unchanged.
isDisposable-
todoDevelopment placeholder that always throws.

Type Aliases

Type AliasDescription
ThunkA function that takes no arguments and returns a value.

Variables

VariableDescription
constFalseA Thunk that returns false.
constNullA Thunk that returns null.
constTrueA Thunk that returns true.
constUndefinedA Thunk that returns undefined.
constVoidA Thunk that returns undefined for void callbacks.