Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/***********
* 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