Last active
May 25, 2017 04:53
-
-
Save hieuhani/2e30057fd43899467fe016ab6df9c242 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Nhan ket qua la 1 array | |
return state.set('menus', fromJS(payload.menus)); | |
// Them phan tu | |
return state.set('menus', state.get('menus').push(fromJS(payload.menu))); | |
// Update 1 phan tu | |
return state | |
.set('sets', state.get('sets').map((setItem) => { | |
if (setItem.get('id') === payload.set.id) { | |
return fromJS(payload.set) | |
} | |
return setItem; | |
})); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment