rsnext/examples/with-rematch/shared/utils.js
2020-05-26 08:24:36 -04:00

10 lines
279 B
JavaScript

// Robust way to check if it's Node or browser
import { useDispatch } from 'react-redux'
export const checkServer = () => {
return typeof window === 'undefined'
}
export const useRematchDispatch = (selector) => {
const dispatch = useDispatch()
return selector(dispatch)
}