react-rv
    Preparing search index...

    Interface Rv<T>

    A reactive variable (RV) function that allows getting, setting, and subscribing to changes.

    interface Rv<T> {
        on(listener: Listener<T>): CleanupFn;
        (): T;
        (newValue: T, options?: RvOptions<T>): T;
    }

    Type Parameters

    • T

      The type of the stored value.

    • Retrieves the current value of the reactive variable.

      Returns T

      The current value of type T.

    • Updates the value of the reactive variable.

      Parameters

      • newValue: T

        The new value to set.

      • Optionaloptions: RvOptions<T>

        Optional configuration for the update.

      Returns T

      The updated value.

    Index

    Methods

    Methods

    • Subscribes a listener to value changes.

      Parameters

      • listener: Listener<T>

        A callback function that is triggered when the value changes.

      Returns CleanupFn

      A cleanup function to remove the listener.