Component state tracker.

Hierarchy

  • StateTracker
    • ComponentState

Constructors

Accessors

  • get onUpdate(): OnStateUpdate
  • OnStateUpdate state updates sender.

    A state update will be sent to it whenever an update() function is called.

    The [OnEvent__symbol] property is an alias of this one.

    Returns

    State updates sender.

    Returns OnStateUpdate

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

    All receivers registered with onUpdate will receive this update.

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

      • <T>(this: void, path: StatePath, newValue: T, oldValue: T): 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

  • Returns OnStateUpdate

  • 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

  • Starts tracking of partial state under the given path.

    Returns

    New partial state tracker.

    Parameters

    • path: StatePath

      A path to state part.

    Returns StateTracker

Generated using TypeDoc