Created
February 22, 2021 20:04
-
-
Save AllGistsEqual/5c8a988d0e167faf124d60ab08eea9da 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
// File: src/redux/ducks/article.ts | |
const articleReducer = createReducer(initialState, (builder) => { | |
builder | |
.addCase(setArticlesStatus, (state, action) => { | |
const { status } = action.payload | |
state.status = status | |
}) | |
.addCase(storeArticlesData, (state, action) => { | |
const { data } = action.payload | |
state.data = data | |
state.status = 'idle' | |
}) | |
}) | |
export default articleReducer |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment