diff options
author | Wilson Page <wilsonpage@me.com> | 2013-09-17 11:18:41 +0100 |
---|---|---|
committer | Wilson Page <wilsonpage@me.com> | 2013-09-17 11:18:41 +0100 |
commit | cd530f02af6b0c4f5f54811c0696adc0a9f972ae (patch) | |
tree | 3c1f3f56f26173dc3ef6fa9f6a34df0cdfeb701e | |
parent | c166f64b0dcc59b4b59a09fe6152695482d53678 (diff) | |
download | fastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.zip fastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.tar.gz fastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.tar.bz2 |
Documentation for .defer()
-rw-r--r-- | README.md | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -97,6 +97,17 @@ var id = fastdom.write(function(){}); fastdom.clearWrite(id); ``` +### FastDom#defer(frames) + +Defers a job for the number of frames specified. This is useful is you have a particualrly expensive piece of work to do, and don't want it to be done with all the other work. + +For example; you are using third party library that doesn't expose an API that allows you split DOM read/write work, `fastdom.defer()` will push this work futher into the future and prevent it from disrupting other carefully batched work. + +```js +var id = fastdom.write(function(){}); +fastdom.clearWrite(id); +``` + ## Tests #### With PhantomJS |