source: imaps-frontend/node_modules/@use-gesture/react/src/useWheel.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: 692 bytes
Line 
1import { registerAction, wheelAction } from '@use-gesture/core/actions'
2import { UserWheelConfig, Handler, EventTypes } from '@use-gesture/core/types'
3import { useRecognizers } from './useRecognizers'
4
5/**
6 * Wheel hook.
7 *
8 * @param {Handler<'wheel'>} handler - the function fired every time the wheel gesture updates
9 * @param {UserWheelConfig} config - the config object including generic options and wheel options
10 */
11export function useWheel<EventType = EventTypes['wheel'], Config extends UserWheelConfig = UserWheelConfig>(
12 handler: Handler<'wheel', EventType>,
13 config?: Config
14) {
15 registerAction(wheelAction)
16 return useRecognizers({ wheel: handler }, config || {}, 'wheel')
17}
Note: See TracBrowser for help on using the repository browser.