-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Knockout computed update notification sometimes not firing #24
Comments
Thanks for reporting this. I've come up with an example that reproduces the problem. function ViewModel() {
var self = this;
self.x = ko.observable(1);
self.y = ko.computed(function() {
return self.x() * 2;
}).extend({throttle:1000});
self.update = function() {
self.y();
}
} If |
Here's a much simpler example. http://jsfiddle.net/mbest/33wmc6rn/ function ViewModel() {
var self = this;
self.x = ko.observable(1);
self.y = ko.computed(function() {
return self.x() * 2;
});
self.update = function() {
self.x(self.x()+1);
self.y();
}
} I'm working on fix now. |
Awesome! |
Did it work for you? |
Oh, I'm so sorry, forgot to report. |
I am currently investigating a very weird bug in my application which seems to be strongly-related to the ko-deferred-updates v.3.2.0.
When using the newest version, sometimes (in a very hard to reproduce way) either the update notification of a changed computed is not sent or subscribing computed's just ignore said notification. Either way I detect bindings that stay frozen in states, dependent computed's that get corrupted computations because they use old values, etc.
It may be the same for normal observables but since I use more computed's than observables, I did not find such a case with observables in my application yet.
Unfortunately I was unable to find a reproducible way.
Used Knockout version is the newest, 3.2.0.
This does not happen when using ko-deferred-updates v.3.1.0 (albeit with a small hack to deactivate the version check to use it for ko 3.2.0, which worked perfectly for months) and thus only started to occur since the last update.
The text was updated successfully, but these errors were encountered: