Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
manipulateRemoteData: function(url) {
return new Promise((resolve, reject) => {
var result = [];
$.getJSON(url, (json) => {jsonFromUrl = json;
result = jsonFromUrl.people.sort((a, b) => {
if(a.name > b.name) return 1;
if(a.name == b.name) return 0;
return -1;})
});
resolve(result);
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment