react-rv
    Preparing search index...

    Function useRvEffect

    • React hook to subscribe to updates of a reactive variable.

      Note: callback is always using current scope.

      Type Parameters

      • T

      Parameters

      • rv: Rv<T>

        The reactive variable to subscribe to.

      • f: Listener<T>

        A callback function triggered whenever the reactive variable is updated. The first and second arguments are the new and the old value of this rv.

      Returns void

      const counter = rv(0)

      useRvEffect(counter, (newVal, oldVal) => {
      console.table({ newVal, oldVal })
      })