Skip to content

Type Alias: UsePassthroughHookOptions<P>

ts
type UsePassthroughHookOptions<P> = {
  debounceMs?: number;
  fallback?: (...args: P) => void | Promise<void>;
  immediate?: boolean;
  throttleMs?: number;
};

Options for usePassthroughHook that control when and how a fallback is executed and how the produced handler is scheduled.

The passthrough hook builds an invoker for a given event that respects component props (onX prop handlers), attribute listeners, and optional "callOnX" hook arrays before falling back to your own handler. These options allow you to customize that behavior.

Type Parameters

Type ParameterDescription
P extends any[]Tuple of the event argument types

Properties

PropertyTypeDescription
debounceMs?numberIf set (> 0), the produced handler will be debounced by the given milliseconds.
fallback?(...args: P) => void | Promise<void>Optional function called when there are no bound handlers and no registered call-on hooks for the event. Receives the original event arguments. May be async.
immediate?booleanControls when the produced handler runs when neither debounce nor throttle is used: - undefined (default): run on the next Vue tick (nextTick) - false: run synchronously in the current tick - true: run as a microtask (queueMicrotask)
throttleMs?numberIf set (> 0), the produced handler will be throttled by the given milliseconds.