Class: Dependency

Tracker.Dependency()

new Dependency()

A Dependency represents an atomic unit of reactive data that a computation might depend on. Reactive data sources such as Session or Minimongo internally create different Dependency objects for different pieces of data, each of which may be depended on by multiple computations. When the data changes, the computations are invalidated.

Source:

Methods

changed()

Invalidate all dependent computations immediately and remove them as dependents.

Source:

depend(fromComputationopt) → {Boolean}

Declares that the current computation (or `fromComputation` if given) depends on `dependency`. The computation will be invalidated the next time `dependency` changes. If there is no current computation and `depend()` is called with no arguments, it does nothing and returns false. Returns true if the computation is a new dependent of `dependency` rather than an existing one.

Parameters:
Name Type Attributes Description
fromComputation Tracker.Computation <optional>
An optional computation declared to depend on `dependency` instead of the current computation.
Source:
Returns:
Type
Boolean

hasDependents() → {Boolean}

True if this Dependency has one or more dependent Computations, which would be invalidated if this Dependency were to change.

Source:
Returns:
Type
Boolean