promised-models
Advanced tools
Comparing version 0.0.17 to 0.0.18
@@ -30,2 +30,3 @@ /** | ||
this._eventEmitter = new EventEmitter(); | ||
this._ready = true; | ||
this._readyPromise = fulfill(); | ||
@@ -308,3 +309,3 @@ this.storage = new Storage(); | ||
isReady: function () { | ||
return this._readyPromise.isResolved(); | ||
return this._ready; | ||
}, | ||
@@ -317,11 +318,3 @@ | ||
ready: function () { | ||
var model = this; | ||
return model._readyPromise.always(function (p) { | ||
//promise not changed or rejected | ||
if (model._readyPromise === p) { | ||
return p; | ||
} else { | ||
return model.ready(); | ||
} | ||
}); | ||
return this._readyPromise; | ||
}, | ||
@@ -336,2 +329,3 @@ | ||
if (this.isReady()) { | ||
this._ready = false; | ||
this.trigger('calculate'); | ||
@@ -342,2 +336,5 @@ //start _calculate on next tick | ||
}); | ||
this._readyPromise.fail(function () { | ||
model._ready = true; | ||
}).done(); | ||
} else { | ||
@@ -380,2 +377,5 @@ this._requireMoreCalculations = true; | ||
this._requireMoreCalculations = false; | ||
this._ready = false; | ||
if (n >= model.maxCalculations) { | ||
@@ -406,3 +406,2 @@ return model._throwCalculationLoop(); | ||
model._setCalculatedData(calculateData); | ||
// model.set(calculateData); | ||
if (model._checkContinueCalculations()) { | ||
@@ -417,2 +416,3 @@ return model._calculate(++n); | ||
} | ||
model._ready = true; | ||
}); | ||
@@ -419,0 +419,0 @@ }, |
{ | ||
"description": "promise based, typed attributes, nested models and collections", | ||
"name": "promised-models", | ||
"version": "0.0.17", | ||
"version": "0.0.18", | ||
"repository": "git@github.com:delfrrr/promised-models.git", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
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
106154
2732