Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do the 'dirty' notification after scheduling evaluation so order of e…
…valuation is maintained.
- Loading branch information
Showing
1 changed file
with
3 additions
and
3 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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
|
@@ -190,9 +190,6 @@ var newComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, | ||
if (_isBeingEvaluated) | if (_isBeingEvaluated) | ||
return; | return; | ||
_needsEvaluation = true; | _needsEvaluation = true; | ||
dependentObservable["notifySubscribers"](_latestValue, "dirty"); | |||
if (!_needsEvaluation) // The notification might have triggered an evaluation | |||
return; | |||
var throttleEvaluationTimeout = dependentObservable['throttleEvaluation']; | var throttleEvaluationTimeout = dependentObservable['throttleEvaluation']; | ||
if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { | if (throttleEvaluationTimeout && throttleEvaluationTimeout >= 0) { | ||
clearTimeout(evaluationTimeoutInstance); | clearTimeout(evaluationTimeoutInstance); | ||
|
@@ -201,6 +198,9 @@ var newComputed = function (evaluatorFunctionOrOptions, evaluatorFunctionTarget, | ||
ko.tasks.processDelayed(evaluateImmediate, true, disposeWhenNodeIsRemoved); | ko.tasks.processDelayed(evaluateImmediate, true, disposeWhenNodeIsRemoved); | ||
else | else | ||
evaluateImmediate(); | evaluateImmediate(); | ||
dependentObservable["notifySubscribers"](_latestValue, "dirty"); | |||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
scottmessinger
|
|||
if (!_needsEvaluation && throttleEvaluationTimeout) // The notification might have triggered an evaluation | |||
clearTimeout(evaluationTimeoutInstance); | |||
} | } | ||
|
|
||
function addDependency(subscribable) { | function addDependency(subscribable) { | ||
|
This line is throwing an error.
I'm having a hard time reproducing it in jsfiddle, but I can't figure out why it would break my app. I'm including deferred-updates after knockout-2.0.0 just as I did before this change. Any ideas what's going on?
Here's the full stacktrace from Chrome if you're interested:
https://gist.github.com/1927694