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:
911 bytes
|
Rev | Line | |
---|
[d565449] | 1 | import { dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction } from '@use-gesture/core/actions'
|
---|
| 2 | import { GestureHandlers, UserGestureConfig, EventTypes, AnyHandlerEventTypes } from '@use-gesture/core/types'
|
---|
| 3 | import { createUseGesture } from './createUseGesture'
|
---|
| 4 |
|
---|
| 5 | /**
|
---|
| 6 | * @public
|
---|
| 7 | *
|
---|
| 8 | * The most complete gesture hook, allowing support for multiple gestures.
|
---|
| 9 | *
|
---|
| 10 | * @param {GestureHandlers} handlers - an object with on[Gesture] keys containg gesture handlers
|
---|
| 11 | * @param {UserGestureConfig} config - the full config object
|
---|
| 12 | */
|
---|
| 13 | export function useGesture<
|
---|
| 14 | HandlerTypes extends AnyHandlerEventTypes = EventTypes,
|
---|
| 15 | Config extends UserGestureConfig = UserGestureConfig
|
---|
| 16 | >(handlers: GestureHandlers<HandlerTypes>, config?: Config) {
|
---|
| 17 | const hook = createUseGesture([dragAction, pinchAction, scrollAction, wheelAction, moveAction, hoverAction])
|
---|
| 18 | return hook(handlers, config || ({} as Config))
|
---|
| 19 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.