A state variable. This class refines the Read interface by letting get return T rather than T | Absent. If the state should be nullable or uninitialized, this has to be reflected explicitly in T.

Type Parameters

  • T

Implements

Constructors

Methods

Constructors

  • Create a new state variable and assign it an initial value.

    Type Parameters

    • T

    Parameters

    • value: T

      The initial value to assign to this state variable.

    Returns State<T>

Methods

  • Return the current value of this state variable.

    Returns T

  • Set the current value of this state variable.

    Parameters

    • value: T

    Returns void