Commit 3b658768 by jay

.

1 parent c07e5b4c
...@@ -13,6 +13,28 @@ const DoctorOnCall = () => { ...@@ -13,6 +13,28 @@ const DoctorOnCall = () => {
export default DoctorOnCall; export default DoctorOnCall;
const bindMiddleware = middleware => {
if (process.env.NODE_ENV !== "production") {
const { composerWithDevTools, composeWithDevTools } = require("redux-devtools-extension");
return composeWithDevTools(applyMiddleware(...middleware));
}
return applyMiddleware(...middleware);
};
const reducer = (state, action) => {
if (action.type === HYDRATE) {
const nextState = { ...state, ...action.payload };
return nextState;
} else {
return reducers(state, action);
}
};
const initStore = () => {
return createStore(reducer, bindMiddleware([thunkMiddleware]));
};
export const wrapper = createWrapper(initStore); export const wrapper = createWrapper(initStore);
/** For server side rendering */ /** For server side rendering */
export const getStaticProps = wrapper.getStaticProps( export const getStaticProps = wrapper.getStaticProps(
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!