Created
April 17, 2019 14:57
-
-
Save johnnykoo84/1861c929acb22b737a81832723bfbb45 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
loadMoreArticles = direction => { | |
// 상태에 저장되어 있는 allArticles와 currentCategory를 이용해서 | |
// 유저에게 보여 줄 currentCategoryArticles를 가져온다. | |
const { allArticles, currentCategory } = this.state; | |
const currentCategoryId = this.categories.find( | |
category => category.name === currentCategory | |
).id; | |
const currentCategoryArticles = allArticles.filter( | |
article => article.UserId === currentCategoryId | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment