2019-05-12 11:13:02 +02:00
|
|
|
// Robust way to check if it's Node or browser
|
2020-05-26 14:24:36 +02:00
|
|
|
import { useDispatch } from "react-redux";
|
2019-05-12 11:13:02 +02:00
|
|
|
export const checkServer = () => {
|
2019-05-29 01:06:13 +02:00
|
|
|
return typeof window === "undefined";
|
2019-05-12 11:13:02 +02:00
|
|
|
};
|
2020-05-26 14:24:36 +02:00
|
|
|
|
|
|
|
export const useRematchDispatch = (selector) => {
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
return selector(dispatch);
|
|
|
|
};
|