O'Reilly logo

KnockoutJS Web Development by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 of this whenever Knockout invokes your callback functions.
  • options: This is

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required