source: imaps-frontend/node_modules/@use-gesture/react/src/useMove.ts

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 677 bytes
RevLine 
[d565449]1import { registerAction, moveAction } from '@use-gesture/core/actions'
2import { UserMoveConfig, Handler, EventTypes } from '@use-gesture/core/types'
3import { useRecognizers } from './useRecognizers'
4
5/**
6 * Move hook.
7 *
8 * @param {Handler<'move'>} handler - the function fired every time the move gesture updates
9 * @param {UserMoveConfig} config - the config object including generic options and move options
10 */
11export function useMove<EventType = EventTypes['move'], Config extends UserMoveConfig = UserMoveConfig>(
12 handler: Handler<'move', EventType>,
13 config?: Config
14) {
15 registerAction(moveAction)
16 return useRecognizers({ move: handler }, config || {}, 'move')
17}
Note: See TracBrowser for help on using the repository browser.