Skip to content

use_ref

API

counterweight.hooks.use_ref

use_ref(initial_value: Getter[T] | T) -> Ref[T]
PARAMETER DESCRIPTION
initial_value

the initial value of the ref. It can either be the initial value itself, or a zero-argument function that returns the initial value.

TYPE: Getter[T] | T

RETURNS DESCRIPTION
Ref[T]

A Ref that holds a reference to the given value.

counterweight.hooks.Ref

current instance-attribute

current: T