Created
July 30, 2016 19:12
-
-
Save IrakliJani/049bf83b25ddde9ee3a5d3ff2464cf8a to your computer and use it in GitHub Desktop.
Listening actions in different reducers
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
function usersReducer (state = Map(), action) { | |
switch (action.type) { | |
... | |
case REMOVE_USER: | |
return state.delete(action.id) | |
... | |
} | |
} | |
function tasksReducer (state = Map(), action) { | |
switch (action.type) { | |
... | |
case REMOVE_USER: | |
return state.filter(task => task.user_id !== action.id) | |
... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment