Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feed items added asynchronously are not sorted by date #28

Open
ruzz311 opened this issue Apr 9, 2015 · 1 comment
Open

Feed items added asynchronously are not sorted by date #28

ruzz311 opened this issue Apr 9, 2015 · 1 comment

Comments

@ruzz311
Copy link

ruzz311 commented Apr 9, 2015

If my recordset is not sorted by descending date my feed is out of order. It would be nice if there was a sort before the render.

I noticed this behavior this when I added items to the feed from multiple async sources.

@WestonThayer
Copy link

FWIW it's easy to add this yourself before render:

feed.items.sort((a, b) => b.date - a.date)

will do a reverse sort (newest to oldest). I could see potentially changing that sort if you had posts with an "original published date" and an "updated date" — perhaps you'd want to bubble the newly updated posts to the top.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants