Created
September 16, 2018 12:49
-
-
Save hg-pyun/5ada9ce118ea9f76d457938d5cd2dabc to your computer and use it in GitHub Desktop.
currying.11.js
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
getters: { | |
// ... | |
getTodoById: (state, getters) => (id) => { | |
return state.todos.find(todo => todo.id === id) }} | |
store.getters.getTodoById(2) // -> { id: 2, text: '...', done: false } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment