RAGS - v1.10.0
    Preparing search index...

    Function derive

    • Creates a derived Variable from multiple source Variables.

      Similar to merge but operates on Variables directly rather than Bindings, and returns a Variable instead of a Binding.

      Type Parameters

      • V
      • const Deps extends Variable<any>[]
      • Args extends { [K in string | number | symbol]: Deps[K] extends Variable<T> ? T : never }

      Parameters

      • deps: Deps

        Array of Variables to observe

      • fn: (...args: Args) => V

        Function that receives all current values and returns the derived value

      Returns Variable<V>

      A new Variable containing the derived value