-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from cb1kenobi/v3
v3.0.0!
- Loading branch information
Showing
19 changed files
with
5,081 additions
and
3,133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"presets": ["nodejs-lts"] | ||
"plugins": ["transform-es2015-modules-commonjs"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
language: node_js | ||
node_js: | ||
- "4" | ||
- "5" | ||
- "6" | ||
- "7" | ||
os: | ||
- linux | ||
sudo: false | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
const gawk = require('../dist/index').gawk; | ||
|
||
const gobj = gawk({ | ||
foo: { | ||
bar: {} | ||
} | ||
}); | ||
|
||
let counter = 0; | ||
gawk.watch(gobj, () => { | ||
counter++; | ||
}); | ||
|
||
const n = 100000; | ||
console.log(`Set size: ${n}`); | ||
|
||
const start = Date.now(); | ||
|
||
for (let i = 0; i < n; i++) { | ||
gawk.mergeDeep(gobj.foo, { | ||
bar: { | ||
baz: { | ||
a: Math.random(), | ||
b: Math.random(), | ||
c: Math.random() | ||
} | ||
} | ||
}); | ||
} | ||
|
||
const delta = Date.now() - start; | ||
|
||
console.log('Finished in ' + (delta / 1000).toFixed(2) + 's'); | ||
|
||
if (counter === n) { | ||
console.log(`Worked! Fired watcher ${counter} times`); | ||
} else { | ||
console.log(`Failed! Expected ${n} events, got ${counter}`); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "gawk", | ||
"version": "2.0.0", | ||
"version": "3.0.0", | ||
"description": "Observable JavaScript object model", | ||
"main": "./dist/index.js", | ||
"author": "Chris Barber <[email protected]> (https://github.com/cb1kenobi)", | ||
|
@@ -23,30 +23,29 @@ | |
"test": "gulp test" | ||
}, | ||
"dependencies": { | ||
"object-hash": "^1.1.2", | ||
"source-map-support": "^0.4.1" | ||
"source-map-support": "^0.4.6" | ||
}, | ||
"devDependencies": { | ||
"babel-eslint": "^6.1.0", | ||
"babel-preset-nodejs-lts": "^1.2.2", | ||
"babel-eslint": "^7.1.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.18.0", | ||
"chai": "^3.5.0", | ||
"codeclimate-test-reporter": "^0.3.3", | ||
"coveralls": "^2.11.9", | ||
"del": "^2.2.1", | ||
"codeclimate-test-reporter": "^0.4.0", | ||
"coveralls": "^2.11.15", | ||
"del": "^2.2.2", | ||
"esdoc-es7-plugin": "^0.0.3", | ||
"gulp": "^3.9.1", | ||
"gulp-babel": "^6.1.2", | ||
"gulp-babel-istanbul": "^1.4.0", | ||
"gulp-debug": "^2.1.2", | ||
"gulp-esdoc": "^0.2.0", | ||
"gulp-eslint": "^3.0.0", | ||
"gulp-babel-istanbul": "^1.5.0", | ||
"gulp-debug": "^3.0.0", | ||
"gulp-esdoc": "^0.3.0", | ||
"gulp-eslint": "^3.0.1", | ||
"gulp-filter": "^4.0.0", | ||
"gulp-inject-modules": "^1.0.0", | ||
"gulp-load-plugins": "^1.2.4", | ||
"gulp-mocha": "^2.2.0", | ||
"gulp-load-plugins": "^1.4.0", | ||
"gulp-mocha": "^3.0.1", | ||
"gulp-plumber": "^1.1.0", | ||
"gulp-sourcemaps": "^2.0.0-alpha", | ||
"sinon": "^1.17.4", | ||
"gulp-sourcemaps": "^2.2.0", | ||
"sinon": "^1.17.6", | ||
"sinon-chai": "^2.8.0" | ||
}, | ||
"homepage": "https://github.com/cb1kenobi/gawk", | ||
|
@@ -56,6 +55,6 @@ | |
"url": "git://github.com/cb1kenobi/gawk.git" | ||
}, | ||
"engines": { | ||
"node": ">=4.0.0" | ||
"node": ">=6.0.0" | ||
} | ||
} |
Oops, something went wrong.