Coding documents for computed observables
We have included the following documents about observables just for reference here. While these were available online on the KnockoutJS site, it seemed like a good idea to include them here so you don't have to keep jumping between the website and the book.
A computed observable can be constructed using one of the following forms.
Form 1
The ko.computed( evaluator [, targetObject, options] )
form supports the most common case of creating a computed observable. It has the following attributes:
evaluator
: This is a function that is used to evaluate the computed observable's current value.targetObject
: If given, it defines the value ofthis
whenever Knockout invokes your callback functions.options
: This is an object with further properties for the computed observable. See the full list in the following section.
Form 2
The ko.computed( options )
parameter, is a single parameter form for creating a computed observable that accepts a JavaScript object with...