Hi
I've found out (thanks to this forum) that for computed observables, it's not possible to chain writes like this:
viewModel.someComputed(20).otherComputed(100).someObservable('hi')
and this bummed me because I have many observables which I now want to extend - so they will become computed,
and so I have to remove all the chained calls.
So I've made this small change in the dependantObservable() function (just added: return this;)
function dependentObservable() {
if (arguments.length > 0) {
set.apply(dependentObservable, arguments);
return this;
} else {
return get();
}
}
And now I can chain writes!
My question is: what's the downside of doing this?
I assume there is one, because this wasn't implemented :P
Thanks,
Uri G