Comparing version 0.6.0 to 0.7.0
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
"version": "0.7.0", | ||
"main": "index.js", | ||
"scripts": [ | ||
"lib/fastdom.js" | ||
"index.js" | ||
], | ||
@@ -9,0 +9,0 @@ "ignore": [ |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
"version": "0.7.0", | ||
"main": "index.js", | ||
"scripts": [ | ||
"lib/fastdom.js" | ||
"index.js" | ||
], | ||
"ignore": [ | ||
"examples/" | ||
"examples/", | ||
"test/", | ||
"README.md" | ||
], | ||
"license": "MIT" | ||
} | ||
} |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
"version": "0.7.0", | ||
"main": "index.js", | ||
"scripts": { | ||
@@ -7,0 +7,0 @@ "test": "./node_modules/.bin/mocha-phantomjs test/index.html" |
@@ -9,24 +9,26 @@ # fastdom [![Build Status](https://travis-ci.org/wilsonpage/fastdom.png?branch=master)](https://travis-ci.org/wilsonpage/fastdom) | ||
fastdom.read(function() { | ||
console.log('<DOM Read>'); | ||
console.log('read'); | ||
}); | ||
fastdom.write(function() { | ||
console.log('<DOM Write>'); | ||
console.log('write'); | ||
}); | ||
fastdom.read(function() { | ||
console.log('<DOM Read>'); | ||
console.log('read'); | ||
}); | ||
fastdom.write(function() { | ||
console.log('<DOM Write>'); | ||
console.log('write'); | ||
}); | ||
``` | ||
// Output: | ||
Outputs: | ||
<DOM Read> | ||
<DOM Read> | ||
<DOM Write> | ||
<DOM Write> | ||
``` | ||
read | ||
read | ||
write | ||
write | ||
``` | ||
@@ -44,13 +46,10 @@ ## Examples | ||
``` | ||
or | ||
``` | ||
$ bower install fastdom | ||
``` | ||
``` | ||
$ component install wilsonpage/fastdom | ||
``` | ||
or [download](http://github.com/wilsonpage/fastdom/raw/master/index.js). | ||
or | ||
Old fashioned [download](http://github.com/wilsonpage/fastdom/raw/master/lib/fastdom.js). | ||
## How it works | ||
@@ -88,28 +87,24 @@ | ||
### FastDom#clearRead(id) | ||
### FastDom#defer(frames, callback[, context]) | ||
Removes a job from the 'read' queue by id. | ||
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.read(function(){}); | ||
fastdom.clearRead(id); | ||
fastdom.defer(3, expensiveStuff); | ||
``` | ||
### FastDom#clearWrite(id) | ||
### FastDom#clear(id) | ||
Removes a job from the 'write' queue by id. | ||
Clears **any** scheduled job by id. | ||
```js | ||
var id = fastdom.write(function(){}); | ||
fastdom.clearWrite(id); | ||
``` | ||
var read = fastdom.read(function(){}); | ||
var write = fastdom.write(function(){}); | ||
var defer = fastdom.defer(4, function(){}); | ||
### FastDom#defer(frames, callback[, context]) | ||
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 | ||
fastdom.defer(3, expensiveStuff); | ||
fastdom.clear(read); | ||
fastdom.clear(write); | ||
fastdom.clear(defer); | ||
``` | ||
@@ -116,0 +111,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11642
42158
8
261
141
1