Skip to content

Instantly share code, notes, and snippets.

@JaySunSyn
Last active January 17, 2018 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JaySunSyn/b9ad9e16ec69ddc4ee4646ecb0353b05 to your computer and use it in GitHub Desktop.
Save JaySunSyn/b9ad9e16ec69ddc4ee4646ecb0353b05 to your computer and use it in GitHub Desktop.
Step 2
<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