Skip to content

Instantly share code, notes, and snippets.

@philipszdavido
Created September 18, 2017 17:41
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 philipszdavido/2c697b5b4a6b2f83c600dcf550759138 to your computer and use it in GitHub Desktop.
Save philipszdavido/2c697b5b4a6b2f83c600dcf550759138 to your computer and use it in GitHub Desktop.
//src/app/app.component.ts
article: Observable<Article[]>
constructor(private store: Store<fromArticle.State>){
this.article = this.store.select(fromArticle.getArticles).subscribe((v: Array<Article>) => {
this.article = v.sort((a: Article, b: Article) => {
return b.points - a.points
})
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment