Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fastdom

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastdom - npm Package Compare versions

Comparing version 0.6.0 to 0.7.0

History.md

6

bower.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc