Skip to content

Instantly share code, notes, and snippets.

@rniwa
Last active May 31, 2016 01:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rniwa/e7656198370c5af502c48087a6fe7c70 to your computer and use it in GitHub Desktop.
Save rniwa/e7656198370c5af502c48087a6fe7c70 to your computer and use it in GitHub Desktop.
transaction = new DOMTransaction(function (container, articleList) {
var childCount = container.childNodes.length;
for (let article of articleList)
container.append(article);
// No DOM mutation is made until this function exits.
console.assert(childCount == container.childNodes.length);
});
transaction.commit(element, articles);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment