Permalink
Browse files

Made chaining possible on writable computed's

  • Loading branch information...
1 parent 365bfee commit 0fe43d57aeb0d0f683ccf22941bd26ba5749f22e @antishok committed May 16, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 src/subscribables/dependentObservable.js
@@ -113,6 +113,7 @@ ko.dependentObservable = function (evaluatorFunctionOrOptions, evaluatorFunction
function dependentObservable() {
if (arguments.length > 0) {
set.apply(dependentObservable, arguments);
+ return this; // Permits chained assignments
} else {
return get();
}

2 comments on commit 0fe43d5

@schinckel

I was actually a little suprised this wasn't already there. I only really discovered last night that you can chain writes to observables (and this causes only a single set up update events to fire, apparently), but cannot do the same with writeable dependentObservables.

Please sign in to comment.