Skip to content

Instantly share code, notes, and snippets.

@jasonknight
Created November 5, 2019 00:07
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 jasonknight/9cd522a474980e9965c32231cdbbfa80 to your computer and use it in GitHub Desktop.
Save jasonknight/9cd522a474980e9965c32231cdbbfa80 to your computer and use it in GitHub Desktop.
function renderPost(post) {
// some rendering logic
if ( getAdminEmails(users).indexOf(current_user.email) != -1 ) {
renderAdminControls(post);
}
}
$.getJSON('/posts',function (posts) {
posts.forEach( function (post) {
renderPost(post);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment