@dxos/app-framework - v0.15.0
    Preparing search index...

    Function useOperation

    • Binds an operation to a UI callback in one step: map turns the component's callback arguments into the operation's input. The handler identity is stable across renders (the mapper and options read through refs), so it replaces per-handler useCallback boilerplate.

      Type Parameters

      • TArgs extends readonly unknown[]
      • TInput

      Parameters

      • operation: Definition<TInput, unknown>
      • map: (...args: TArgs) => TInput
      • Optionaloptions: InvokeOptions

      Returns (...args: TArgs) => void