12 lines
No EOL
334 B
JavaScript
12 lines
No EOL
334 B
JavaScript
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; |