Last active
December 22, 2019 13:46
-
-
Save cpv123/24eb953fa8627368b6eec9f0171bea85 to your computer and use it in GitHub Desktop.
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
const getImmutableTodosByCategory = (todos, categoryId) => ( | |
todos.filter(todo => ( | |
todo.get('categories').filter(category => category.get('id') === categoryId).size > 0 | |
) | |
) | |
const getTodosByCategory = (todos, categoryId) => ( | |
todos.filter(todo => ( | |
todo.categories.filter(category => category.id === categoryId).length > 0 | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment