import { useCallback } from 'react' ; import { useDispatch } from 'react-redux' ; import { refreshView } from '../actions/uiActions' ; param hard example const useRefresh = ( ) => { const dispatch = useDispatch ( ) ; return useCallback ( ( hard ? ) => { dispatch ( refreshView ( hard ) ) ; } , [ dispatch ] ) ; } ; export default useRefresh ;