Computed observable reference

Computed Observable Reference

The following documentation describes how to construct and work with computed observables.

Constructing a computed observable

A computed observable can be constructed using one of the following forms:

  1. ko.computed( evaluator [, targetObject, options] ) — This form supports the most common case of creating a computed observable.
    • evaluator — A function that is used to evaluate the computed observable’s current value.
    • targetObject — If given, defines the value of this whenever KO invokes your callback functions. See the section on managing this for more information.
    • options — An object with further properties for the computed observable. See the full list below.
  2. ko.computed( options ) — This single parameter form for creating a computed observable ac