summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilson Page <wilsonpage@me.com>2013-09-17 11:18:41 +0100
committerWilson Page <wilsonpage@me.com>2013-09-17 11:18:41 +0100
commitcd530f02af6b0c4f5f54811c0696adc0a9f972ae (patch)
tree3c1f3f56f26173dc3ef6fa9f6a34df0cdfeb701e
parentc166f64b0dcc59b4b59a09fe6152695482d53678 (diff)
downloadfastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.zip
fastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.tar.gz
fastdom-cd530f02af6b0c4f5f54811c0696adc0a9f972ae.tar.bz2
Documentation for .defer()
-rw-r--r--README.md11
1 files changed, 11 insertions, 0 deletions
diff --git a/README.md b/README.md
index 4ab9f4a..4e53576 100644
--- a/README.md
+++ b/README.md
@@ -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