Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at main 24 lines 637 B view raw
1import {useEffect} from 'react' 2 3import { 4 type GlobalGestureEvents, 5 useGlobalGestureEvents, 6} from '#/state/global-gesture-events' 7 8/** 9 * Listen for global gesture events. Callback should be wrapped with 10 * `useCallback` or otherwise memoized to avoid unnecessary re-renders. 11 */ 12export function useOnGesture( 13 onGestureCallback: (e: GlobalGestureEvents['begin']) => void, 14) { 15 const ctx = useGlobalGestureEvents() 16 useEffect(() => { 17 ctx.register() 18 ctx.events.on('begin', onGestureCallback) 19 return () => { 20 ctx.unregister() 21 ctx.events.off('begin', onGestureCallback) 22 } 23 }, [ctx, onGestureCallback]) 24}