dom-batch
Eliminates layout thrashing by batching DOM read/write interactions.
var dom = ; dom; dom; dom; dom; // Output: <DOM Read><DOM Read><DOM Write><DOM Write>
API
DomBatch#read(callback[, context])
Schedules a task for the 'read' queue.
dom;
DomBatch#write(callback[, context])
Schedules a task for the 'write' queue.
dom;
DomBatch#clearRead(callback)
Removes a task from the 'read' queue.
var {}; dom;dom;
DomBatch#clearWrite(callback)
Removes a task from the 'write' queue.
var {}; dom;dom;
Tests
With PhantomJS
$ npm install
$ npm test
Without PhantomJS
$ node_modules/.bin/buster-static
...then visit http://localhost:8282/ in browser
Author
- Wilson Page - @wilsonpage
Contributors
- Wilson Page - @wilsonpage
- George Crawford - @georgecrawford