Last active
January 13, 2020 02:26
-
-
Save mpcowan/4574e6e1ea0edb321047733f982a7d16 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
const normalizeActionType = (action) => { | |
const collapsable = [ | |
'updateBoard', | |
'updateCard', | |
'updateList', | |
'updateChecklist' | |
]; | |
if (collapsable.includes(action.type)) { | |
const updatedKeys = Object.keys(action.data.old); | |
if (updatedKeys.length > 0) { | |
return `${action.type}:${updatedKeys[0]}`; | |
} | |
} | |
return action.type; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment