Comparing version 0.1.1 to 0.1.3
@@ -84,3 +84,3 @@ (function() { | ||
equals: function(a, b) { | ||
return a.valueOf() === b.valueOf(); | ||
return (a != null ? a.valueOf() : void 0) === (b != null ? b.valueOf() : void 0); | ||
} | ||
@@ -715,2 +715,3 @@ }, | ||
return function(propName, propConfig) { | ||
var val; | ||
Object.defineProperty(instance, propName, { | ||
@@ -727,3 +728,4 @@ configurable: false, | ||
if (propConfig["default"] !== void 0) { | ||
return instance[propName] = (typeof propConfig["default"] === "function" ? propConfig["default"]() : void 0) || propConfig["default"]; | ||
val = _.isFunction(propConfig["default"]) ? propConfig["default"]() : propConfig["default"]; | ||
return instance[propName] = val; | ||
} | ||
@@ -730,0 +732,0 @@ }; |
{ | ||
"name": "scheming", | ||
"version": "0.1.1", | ||
"version": "0.1.3", | ||
"main": "./dest/Scheming.js", | ||
@@ -5,0 +5,0 @@ "repository": "https://github.com/autoric/scheming", |
@@ -424,3 +424,3 @@ # Scheming! | ||
- properties [optional] **String** || **[String]** Specifies the properties to watch on the instance. Accepts a string representing a single property or an array of strings representing one or more properties. If no properties are specified, the entire object will be watched for a change on any property. Will throw an error if any property being watched is not declared as part of the Schema. | ||
- listener **Function** *function(oldVal, newVal)* The listener function that will be called each time the watched properties change. | ||
- listener **Function** *function(newVal, oldVal)* The listener function that will be called each time the watched properties change. | ||
- Listener functions are called asynchronously with a setTimeout of 0. If multiple changes are made to an instance in a synchronous block of code, the listener will not be called for each change. It will be called once, with all changes aggregated. | ||
@@ -427,0 +427,0 @@ - A listener function is always called when the watch is set, even if there were no changes to the watched properties. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
452127
2278