rsnext/examples/with-rematch/shared/utils.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
285 B
JavaScript
Raw Normal View History

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