Last active
January 17, 2018 16:54
-
-
Save JaySunSyn/b9ad9e16ec69ddc4ee4646ecb0353b05 to your computer and use it in GitHub Desktop.
Step 2
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
<script src="../../node_modules/reselect/dist/reselect.js"></script> | |
<script> | |
(() => { | |
const getTodos = (state) => { | |
return state.todo.todos; | |
}; | |
const todos = Reselect.createSelector([getTodos], | |
(todos) => { | |
return todos; | |
} | |
); | |
const todosUpper = Reselect.createSelector([getTodos], | |
(todos) => { | |
return todos.map(t => t.toUpperCase()); | |
} | |
); | |
App = window.App || {}; | |
App.select = { | |
todos, | |
todosUpper, | |
}; | |
})(); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment