mobservable
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -510,4 +510,7 @@ /// <reference path="./typings/node-0.10.d.ts" /> | ||
var os = this.observers; | ||
for (var i = os.length - 1; i >= 0; i--) | ||
os[i].notifyStateChange(this, didTheValueActuallyChange); | ||
for (var i = os.length - 1; i >= 0; i--) { | ||
var o = os[i]; | ||
if (o) | ||
o.notifyStateChange(this, didTheValueActuallyChange); | ||
} | ||
}; | ||
@@ -576,4 +579,2 @@ DNode.prototype.areAllDependenciesAreStable = function () { | ||
this.observing = DNode.trackingStack.pop(); | ||
if (this.isComputed && this.observing.length === 0 && !this.isDisposed) | ||
warn("You have created a function that doesn't observe any values, did you forget to make its dependencies observable?"); | ||
var changes = quickDiff(this.observing, this.prevObserving); | ||
@@ -580,0 +581,0 @@ var added = changes[0]; |
@@ -29,3 +29,15 @@ module.exports = function(grunt) { | ||
perf: ['test/performance.js'] | ||
} | ||
}, | ||
exec: { | ||
cover: "istanbul cover nodeunit test/" | ||
}, | ||
coveralls: { | ||
options: { | ||
// LCOV coverage file relevant to every target | ||
force: false | ||
}, | ||
default: { | ||
src: 'coverage/lcov.info', | ||
} | ||
} | ||
}); | ||
@@ -35,2 +47,4 @@ | ||
grunt.loadNpmTasks('grunt-contrib-nodeunit'); | ||
grunt.loadNpmTasks('grunt-coveralls'); | ||
grunt.loadNpmTasks('grunt-exec'); | ||
@@ -42,5 +56,6 @@ grunt.registerTask("publish", "Publish to npm", function() { | ||
grunt.registerTask("build", ["ts:builddist"]); | ||
grunt.registerTask("cover", ["ts:buildlocal", "exec:cover", "coveralls:default"]); | ||
grunt.registerTask("test", ["ts:buildlocal","ts:buildtypescripttest", "nodeunit:all"]); | ||
grunt.registerTask("perf", ["ts:buildlocal", "nodeunit:perf"]); | ||
}; | ||
}; |
@@ -41,3 +41,3 @@ /// <reference path="./typings/node-0.10.d.ts" /> | ||
var prop:ObservableValue<T,S> = null; | ||
if (Array.isArray && Array.isArray(value)) | ||
@@ -656,4 +656,7 @@ warn("mobservable.value() was invoked with an array. Probably you want to create an mobservable.array() instead of observing a reference to an array?"); | ||
// change to 'for loop, reverse, pre-decrement', https://jsperf.com/for-vs-foreach/32 | ||
for(var i = os.length -1; i >= 0; i--) | ||
os[i].notifyStateChange(this, didTheValueActuallyChange); | ||
for(var i = os.length -1; i >= 0; i--) { | ||
var o = os[i]; | ||
if (o) | ||
o.notifyStateChange(this, didTheValueActuallyChange); | ||
} | ||
} | ||
@@ -750,4 +753,6 @@ | ||
/* TODO: | ||
if (this.isComputed && this.observing.length === 0 && !this.isDisposed) | ||
warn("You have created a function that doesn't observe any values, did you forget to make its dependencies observable?"); | ||
this.log("You have created a function that doesn't observe any values, did you forget to make its dependencies observable?"); | ||
*/ | ||
@@ -754,0 +759,0 @@ var changes = quickDiff(this.observing, this.prevObserving); |
{ | ||
"name": "mobservable", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"description": "Changes are coming! Small library for creating observable properties en functions", | ||
@@ -23,4 +23,5 @@ "main": "dist/mobservable.js", | ||
"grunt-contrib-nodeunit": "^0.4.1", | ||
"grunt-coveralls": "^1.0.0", | ||
"grunt-ts": "^4.0.1", | ||
"memwatch": "^0.2.2", | ||
"grunt-exec": "^0.4.6", | ||
"nscript": "^0.1.5", | ||
@@ -27,0 +28,0 @@ "typescript": "^1.5.0-alpha" |
@@ -7,2 +7,7 @@ # MOBservable | ||
[![Build Status](https://travis-ci.org/mweststrate/MOBservable.svg?branch=master)](https://travis-ci.org/mweststrate/MOBservable) | ||
[![Coverage Status](https://coveralls.io/repos/mweststrate/MOBservable/badge.svg?branch=master)](https://coveralls.io/r/mweststrate/MOBservable) | ||
[![NPM](https://nodei.co/npm/mobservable.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/mobservable/) | ||
[Typescript typings](https://github.com/mweststrate/MOBservable/blob/master/mobservable.d.ts) | ||
@@ -9,0 +14,0 @@ |
@@ -17,7 +17,7 @@ | ||
* process remaining optimizations / todo's, document code | ||
* remove memwatch, make tests smaller? | ||
* ~~remove memwatch, make tests smaller?~~ | ||
* drop event emitter, to make lib smaller and stand alone? https://github.com/joyent/node/blob/master/lib/events.js, note: clone listeners before invoking | ||
* array.observe conform | ||
* ~~array.observe conform~~ | ||
* test browser compatibility? | ||
* badges for build, coverage, npm | ||
* ~~badges for build, coverage, npm~~ | ||
* use typescript 1.5 spread operator | ||
@@ -24,0 +24,0 @@ * use console.trace() in logging where applicable |
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
139071
11
2893
269
7