Skip to content

Instantly share code, notes, and snippets.

@bingex
Created March 13, 2021 18:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bingex/8376c79b1be36eb48fc349b41da5e6a9 to your computer and use it in GitHub Desktop.
Save bingex/8376c79b1be36eb48fc349b41da5e6a9 to your computer and use it in GitHub Desktop.
import { HYDRATE } from 'next-redux-wrapper';
const initialState = {
// initial state here ...
};
const projectsReducer = (state = initialState, action) => {
switch (action.type) {
// This will overwrite client state
case HYDRATE: {
return { ...action.payload.projectsReducer };
}
// reducer logic here ...
default:
return state;
}
};
export default projectsReducer;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment