wilsonpage / fastdom

Eliminates layout thrashing by batching DOM measurement and mutation tasks
6.83k stars 240 forks source link

Implement fastdom.sandbox() #56

Closed wilsonpage closed 8 years ago

wilsonpage commented 9 years ago

Use Case

I'm writing a web-component and need to schedule a few dom related jobs. The web-component is destroyed and those jobs are still pending. I'd like to .clear() just the jobs related to that component.

this.fastdom = fastdom.sandbox();

this.fastdom.read(...);
this.fastdom.write(...);
...

this.fastdom.clear();
wilsonpage commented 9 years ago

This is not the same as creating a brand new FastDom instance as the jobs scheduled via the sandbox should be run the in usual global batch.

wilsonpage commented 9 years ago

Implemented as part of pull-request #58

wilsonpage commented 8 years ago

Landed as an extension f8760dd51f6d7c6573771ecdd39850f1f045f9c0