Skip to content

Instantly share code, notes, and snippets.

@russorat
Created November 13, 2015 18:16
Show Gist options
  • Save russorat/bfffdb585709609a6a65 to your computer and use it in GitHub Desktop.
Save russorat/bfffdb585709609a6a65 to your computer and use it in GitHub Desktop.
/***********
* This function applies a set of changes provided.
* It utilizes tight loops to take advantage of any
* batch processing behind the scenes.
***********/
function applyChanges(changes_to_make) {
for(var i in changes_to_make.kw_to_delete) {
changes_to_make.kw_to_delete[i].remove();
}
for(var i in changes_to_make.labels_to_delete) {
changes_to_make.labels_to_delete[i].remove();
}
for(var i in changes_to_make.labels_to_add) {
changes_to_make.labels_to_add[i].kw.applyLabel(changes_to_make.labels_to_add[i].label);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment