function useOnScroll(fn) {
    return useCallback(node => {
        if (node) node.addEventListener('scroll', fn);
    }, []);
}
/**
 * Hook to run a function when a DOM element scrolls.
 *
 * @param {function} fn - receives the scroll event.
 * @returns {function} - callback ref to be placed on target component
 */
Hook to run a function when a DOM element scrolls.
@param {function} fn - receives the scroll event.
@returns {function} - callback ref to be placed on target component
Hook to run a function when a DOM element scrolls . @param { function } fn - receives the scroll event . @returns { function } - callback ref to be placed on target component
function useOnScroll(fn) {
    return useCallback(node => {
        if (node) node.addEventListener('scroll', fn);
    }, []);
}
function useOnScroll ( fn ) { return useCallback ( node => { if ( node ) node . addEventListener ( 'scroll' , fn ) ; } , [ ] ) ; }
Hook to run a function when a DOM element scrolls.
Hook to run a function when a DOM element scrolls .