mobx-sentinel API doc
    Preparing search index...

    Watcher for tracking changes to observable properties

    • Automatically tracks @observable and @computed properties
    • Supports @watch and @watch.ref annotations
    • Can track nested objects
    • Provides change detection at both property and path levels
    • Can be temporarily disabled via unwatch()
    Index

    Properties

    id: string = ...

    Accessors

    • get changedKeys(): ReadonlySet<KeyPath>

      The keys that have changed

      Returns ReadonlySet<KeyPath>

      • Does not include keys of nested objects
      • Cleared when reset() is called
      • Updated when properties are modified
    • get changedTick(): bigint

      The total number of changes processed

      Observe this value to react to changes.

      Returns bigint

      • Incremented for each change and each affected key
      • Not affected by assumeChanged()
      • Reset to 0 when reset() is called

    Methods

    • Get a watcher instance for the target object.

      Type Parameters

      • T extends object

      Parameters

      • target: T

      Returns Watcher

      • Returns existing instance if one exists for the target
      • Creates new instance if none exists
      • Instances are cached and garbage collected with their targets

      TypeError if the target is not an object.

    • Reset the changed state

      Returns void

      • Clears all changed keys
      • Resets changedTick to 0
      • Clears assumeChanged flag
      • Resets all nested watchers