Created
August 1, 2021 09:20
-
-
Save narennaik/7f691081e25fd2dd95879d15429833ca to your computer and use it in GitHub Desktop.
reducer
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
const reducer = (state, action) => { | |
if (action.type === 'ADD_TODO') { | |
return { ...state, todo: [...state.todo, action.payload] }; | |
} else { | |
return state; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment