Created
October 15, 2016 21:33
-
-
Save talkol/372c673079bb8d4da43532fe402c5071 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
| export function getPosts(state) { | |
| const currentFilter = state.posts.currentFilter; | |
| const postsById = state.posts.postsById; | |
| const postsIdArray = currentFilter === 'all' ? | |
| _.keys(postsById) : | |
| _.filter(_.keys(postsById), (postId) => postsById[postId].topicUrl === currentFilter); | |
| return [postsById, postsIdArray]; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment