import {useCallback} from "react"; import {useDispatch} from "react-redux"; import {mostrarNotificacion} from "../redux"; const useNotificar = () => { const dispatch = useDispatch(); return useCallback((mensaje,tipo = "default") => { dispatch(mostrarNotificacion({mensaje,tipo})); },[dispatch]); }; export default useNotificar;