refactoring: authentication with react-query.

This commit is contained in:
a.bouhuolia
2021-02-20 15:33:20 +02:00
parent 8f680e2068
commit a079f711d4
57 changed files with 1629 additions and 1290 deletions

View File

@@ -0,0 +1,17 @@
import { useCallback } from 'react';
import { useSelector, useDispatch } from "react-redux";
import { setGlobalErrors } from 'store/globalErrors/globalErrors.actions';
export const useSetGlobalErrors = () => {
const dispatch = useDispatch();
return useCallback((errors) => {
dispatch(setGlobalErrors(errors));
}, [dispatch]);
};
export const useGlobalErrors = () => {
const globalErrors = useSelector(state => state.globalErrors.data);
return { globalErrors };
}