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

11 lines
279 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)
}