Comments (3)
Hi DrSammyD,
Can you provide a more complete example for me to work with, you can use either http://jsfiddle.net or http://plnkr.co to share your code.
One thing I did notice is that your computed is missing the second parameter, 'this'. Here is an explanation of what the second parameter is; from knockoutjs.com (http://knockoutjs.com/documentation/computedObservables.html)
"...This defines the value of this when evaluating the computed observable. Without passing it in, it would not have been possible to refer to this.firstName() or this.lastName()...."
So I would expect in your code something like this:
self.rigSelect = ko.dependentObservable(function () {
var rigs = _(self.rigs()).map(function (rig) {
return {
rig: rig,
name: '('+(rig.number())+ ') ' + (rig.name())
};
});
return rigs.value();
}, this);
Hope this helps
from knockout-deferred-updates.
@DrSammyD, what version of Deferred Updates? Can you provide a complete stack trace?
from knockout-deferred-updates.
Sorry guys, I'm having difficulty replicating this error. I went into the code and fixed it locally, then continued coding the rest of my view model, didn't check anything in because it was erring out.
I'm using version 3.0.0
I changed line 534 to
if ((!dependentObservable.equalityComparer || !dependentObservable.equalityComparer(_latestValue, newValue)) /*&& dependentObservable.notifySubscribers != undefined*/)
which fixed the problem, but I'm not sure what else that might do to the code.
My model looked like this
var vm = function () {
var self = this;
self.rigs = ko.observableArray();
self.rigs(service.getRigs());
self.rigSelect = ko.dependentObservable(function () {
var rigs = _(self.rigs()).map(function (rig) {
return {
rig: rig,
name: '('+(rig.number())+ ') ' + (rig.name())
};
});
return rigs.value();
});
};
When I took out my fix to get the stack trace, the error didn't come back. I'll let you know if/when it does.
from knockout-deferred-updates.
Related Issues (20)
- IE8 Compatibility - try...finally blocks HOT 2
- semver tags (for bower compatibility) HOT 2
- Doesn't support KO 3.0.0 HOT 1
- Consider using postMessage rather than setTimeout HOT 1
- Experiencing lock-up (memory leak, +4MB/s, 30% CPU) when including this after knockout in chrome. HOT 17
- Browser CPU goes to 100% after including this js on my page HOT 14
- knockout-deferred-updates does not play nicely with Throttle in Safari IOS 7 HOT 7
- Doesn't support KO 3.1.0beta HOT 2
- Performance seems to be much worse than without deferred-updates HOT 1
- Performance issue... again
- knockout 3.2 HOT 3
- Knockout computed update notification sometimes not firing HOT 5
- Use `after` on update for bindings which are deferred together. HOT 3
- Knockout 3.3? HOT 2
- Breaks deferEvaluation computed bindings on IE10 with KO 3.1+ HOT 5
- Uncaught binding error prevents other bindings from running
- Getting TypeError: currentFrame.callback is not a function HOT 5
- Knockout 3.4 HOT 7
- newCallback used out of scope HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knockout-deferred-updates.