react-rv
    Preparing search index...

    Interface RvInit

    A factory function for creating reactive variables.

    interface RvInit {
        fn: <T>(init: () => T, options?: RvInitOptions<T>) => Rv<T>;
        <T>(val: T, options?: RvInitOptions<T>): Rv<T>;
    }
    • Creates a reactive variable (RV), allowing value retrieval, updates, and subscriptions.

      Type Parameters

      • T

        The type of the stored value.

      Parameters

      • val: T

        The initial value of the reactive variable.

      • Optionaloptions: RvInitOptions<T>

        Optional configuration for the reactive variable.

      Returns Rv<T>

      A reactive variable function that allows getting, setting, and listening for updates.

    Index

    Properties

    Properties

    fn: <T>(init: () => T, options?: RvInitOptions<T>) => Rv<T>

    Creates a reactive variable from an initializer function. The function is immediately executed to determine the initial value.

    Type declaration

      • <T>(init: () => T, options?: RvInitOptions<T>): Rv<T>
      • Type Parameters

        • T

          The type of the stored value.

        Parameters

        • init: () => T

          A function that returns the initial value.

        • Optionaloptions: RvInitOptions<T>

          Optional configuration for equality comparison and event listeners.

        Returns Rv<T>

        A reactive variable function.