Skip to content

Instantly share code, notes, and snippets.

@johnnykoo84
Created April 17, 2019 14:57
Show Gist options
  • Save johnnykoo84/1861c929acb22b737a81832723bfbb45 to your computer and use it in GitHub Desktop.
Save johnnykoo84/1861c929acb22b737a81832723bfbb45 to your computer and use it in GitHub Desktop.
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