ref Namespace
Package: @esfx/ref
Functions
_for(value)
Creates a ref
for an initial value.
Declaration
function _for<T>(value: T): Reference<T>;
Type Parameters
- T
Parameters
- value
- T
Returns
_is(value)
Determines whether value
is a [[ref]].
Declaration
function _is(value: unknown): value is Reference<any>;
Parameters
- value
- unknown
Returns
at(object, key, readonly)
Creates a ref
to a property of an object.
Declaration
function at<T, K extends keyof T>(object: T, key: K, readonly?: boolean): Reference<T[K]>;
Type Parameters
- T
- K
Parameters
- object
- T
- key
- K
- readonly
- boolean
Returns
deref(value)
Declaration
function deref<T>(value: T | Reference<T>): T;
Type Parameters
- T
Parameters
- value
- T | Reference<T>
Returns
out()
Creates a ref
that must be set before it can be read.
Declaration
function out<T>(): Reference<T>;
Type Parameters
- T
Returns
out(get, set)
Declaration
function out<T>(get: () => T, set: (value: T) => void): Reference<T>;
Type Parameters
- T
Parameters
- get
- () => T
- set
- (value: T) => void
Returns
Variables
prototype
Declaration
prototype: Reference<unknown>