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

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

Update repo after prototype presentation

  • Property mode set to 100644
File size: 663 bytes
Line 
1import { parseMergedHandlers } from '@use-gesture/core'
2import { registerAction } from '@use-gesture/core/actions'
3import { Action, GestureHandlers, UserGestureConfig } from '@use-gesture/core/types'
4import { useRecognizers } from './useRecognizers'
5
6export function createUseGesture(actions: Action[]) {
7 actions.forEach(registerAction)
8
9 return function useGesture<Config extends UserGestureConfig = UserGestureConfig>(
10 _handlers: GestureHandlers,
11 _config?: Config
12 ) {
13 const { handlers, nativeHandlers, config } = parseMergedHandlers(_handlers, _config || {})
14 return useRecognizers<Config>(handlers, config, undefined, nativeHandlers)
15 }
16}
Note: See TracBrowser for help on using the repository browser.