import { Dispatch } from 'redux' ; import { useDispatch } from 'react-redux' ; export default function useDispatchToStore ( type ) { const dispatch = useDispatch ( ) ; return ( payload ) => { dispatch ( { type , payload } ) ; } ; } ;