Skip to content

Instantly share code, notes, and snippets.

@srhyne
Last active January 19, 2017 18:31
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 srhyne/2f61fa3ce00b0b656484fb628d175eae to your computer and use it in GitHub Desktop.
Save srhyne/2f61fa3ce00b0b656484fb628d175eae to your computer and use it in GitHub Desktop.
var updates = {};
//pr_id exists and the contact is starred.
if( contact.pr_id && contact.starred ){
return false;
}
if(updates[contact.id]){
clearTimeout(updates[contact.id]);
}
updates[contact.id] = setTimeout(function(){
//apply starred state here.
updateContact(contact);
}, 300);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment