-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Sort meetup list #4662
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
Sort meetup list #4662
Conversation
|
Hey @samajammin, updated from random shuffling to sort by country+city. Kindly review. |
corwintines
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @amm98d, thanks for the contribution. At the moment this wont work. You'll need to do the following.
- import lodash at the top of the file. You could even just import the sortBy method:
import { sortBy } from 'lodash' - store the sorted list in a variable:
const sortedMeetups = sortBy(meetups, ['emoji', 'location']) - use the sortedMeetups variable in the render method of this component where we map over the list of meetups. ie:
sortedMeetups.map
Understood. I followed the syntax from the documentation, my bad. Pushing changes shortly. |
minimalsm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM :-) the deploy preview isn't working right now (unrelated issue) but working fine locally.
corwintines
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, thanks @amm98d!
wackerow
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just cleared some merge conflicts since this file had been worked on since this PR. Thanks @amm98d ! Don't forget to swing over to Discord and claim your POAP =)
|
@all-contributors please add @amm98d for code |
|
I've put up a pull request to add @amm98d! 🎉 |
Description
Added a function that implements the Fisher-Yates Shuffling algorithm.
Related Issue
#4657