State changes tracker.

A state is a tree-like structure of sub-states (nodes) available under StatePath.

When node modified a update should be called. Then all state update receivers registered by onUpdate will receive this update.

Hierarchy

  • StateTracker

Implements

Constructors

Properties

Accessors

Methods

Constructors

Properties

_tracker: SubStateTracker = ...

Accessors

  • get update(): (<T>(this, path, newValue, oldValue) => void)
  • Updates the component state.

    All receivers registered with onUpdate will receive this update.

    Returns (<T>(this, path, newValue, oldValue) => void)

      • <T>(this, path, newValue, oldValue): void
      • Updates the component state.

        All receivers registered with onUpdate will receive this update.

        Type Parameters

        • T

          A type of changed value.

        Parameters

        • this: void
        • path: StatePath
        • newValue: T

          New value.

        • oldValue: T

          Previous value.

        Returns void

Methods

  • Unregisters updates receivers and cuts off their supplies.

    After this method call the updates receivers of this partial state and all nested states won't receive any updates.

    Parameters

    • Optional reason: unknown

      An optional reason to stop tracking.

    Returns void

Generated using TypeDoc