Created
February 8, 2019 09:11
-
-
Save ctrlplusb/0fa7241c9d467a07c5df64f188b92541 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
const store = createStore<StoreModel>({ | |
todos: { | |
// ... | |
add: (state, payload) => { | |
return { | |
...state, | |
items: [ | |
...state.items, | |
payload | |
] | |
}; | |
} | |
}, | |
// ... | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment