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
|
Rev | Line | |
---|
[d565449] | 1 | import { registerAction, moveAction } from '@use-gesture/core/actions'
|
---|
| 2 | import { UserMoveConfig, Handler, EventTypes } from '@use-gesture/core/types'
|
---|
| 3 | import { 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 | */
|
---|
| 11 | export 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.