Created
March 13, 2021 18:55
-
-
Save bingex/8376c79b1be36eb48fc349b41da5e6a9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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