Comparing version 0.5.1 to 0.6.0
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
@@ -6,0 +6,0 @@ "scripts": [ |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
@@ -6,0 +6,0 @@ "scripts": [ |
@@ -200,10 +200,12 @@ | ||
* | ||
* @param {Number} frames | ||
* @param {Function} fn | ||
* @param {Number} frames | ||
* @api public | ||
*/ | ||
FastDom.prototype.defer = function(fn, frames) { | ||
FastDom.prototype.defer = function(frames, fn, ctx) { | ||
if (frames < 0) return; | ||
(function wrapped() { | ||
if (frames-- === 0) { | ||
try { fn(); } catch (e) { | ||
try { fn.call(ctx); } catch (e) { | ||
if (this.onError) this.onError(e); | ||
@@ -270,2 +272,2 @@ } | ||
})(window.fastdom); | ||
})(window.fastdom); |
{ | ||
"name": "fastdom", | ||
"description": "Eliminates layout thrashing by batching DOM read/write operations", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"main": "lib/fastdom.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
@@ -104,3 +104,3 @@ # fastdom [![Build Status](https://travis-ci.org/wilsonpage/fastdom.png?branch=master)](https://travis-ci.org/wilsonpage/fastdom) | ||
### FastDom#defer(callback, frames) | ||
### FastDom#defer(frames, callback[, context]) | ||
@@ -112,3 +112,3 @@ 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. | ||
```js | ||
fastdom.defer(expensiveStuff, 3); | ||
fastdom.defer(3, expensiveStuff); | ||
``` | ||
@@ -136,2 +136,14 @@ | ||
- **Wilson Page** - [@wilsonpage](http://github.com/wilsonpage) | ||
- **George Crawford** - [@georgecrawford](http://github.com/georgecrawford) | ||
- **George Crawford** - [@georgecrawford](http://github.com/georgecrawford) | ||
## License | ||
(The MIT License) | ||
Copyright (c) 2013 Wilson Page <wilsonpage@me.com> | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
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
11250
264
146