createHandlers

Commons
stable

Builds the internal touch-event handler map (touchstart, touchend, touchmove) from a set of directional callbacks. Used by the v-touch directive to bridge raw touch events with high-level swipe/drag gestures.

API

Signature

Full TypeScript signature sourced from the util file.

typescript

API

Parameters

Input parameters accepted by this util.

value
ITouchHandlers
{}
An object of optional directional callbacks: left, right, up, down, start, move, end.

API

Return value

The value returned by this util.

An object with touchstart, touchend, and touchmove native event handlers ready to be bound to a DOM element.

Usage

Examples

Ready-to-paste usage snippets.

Build touch handlers for swipe detection

typescript