weasel API - v0.8.0
    Preparing search index...

    Interface UseDragGestureOptions<TScratch>

    interface UseDragGestureOptions<TScratch = unknown> {
        initScratch?: () => TScratch;
        onActivate?: (ctx: DragGestureCtx<TScratch>) => void;
        onCancel?: (ctx: DragGestureCtx<TScratch>) => void;
        onEnd?: (ctx: DragGestureEndCtx<TScratch>) => boolean | void;
        onGestureEnd?: (committed: boolean) => void;
        onGestureStart?: () => void;
        onMove?: (ctx: DragGestureCtx<TScratch>) => void;
        onStart?: (ctx: DragGestureCtx<TScratch>) => void;
        thresholdReached?: (ctx: DragGestureCtx<TScratch>) => boolean;
    }

    Type Parameters

    • TScratch = unknown
    Index

    Properties

    initScratch?: () => TScratch
    onActivate?: (ctx: DragGestureCtx<TScratch>) => void
    onCancel?: (ctx: DragGestureCtx<TScratch>) => void
    onEnd?: (ctx: DragGestureEndCtx<TScratch>) => boolean | void
    onGestureEnd?: (committed: boolean) => void
    onGestureStart?: () => void
    onMove?: (ctx: DragGestureCtx<TScratch>) => void
    onStart?: (ctx: DragGestureCtx<TScratch>) => void
    thresholdReached?: (ctx: DragGestureCtx<TScratch>) => boolean

    Predicate consulted on each move while phase === 'pending'. Return true to transition to 'active'. The transition fires onActivate before the triggering move's onMove. When omitted, gesture activates at start().