mobx-sentinel API doc
    Preparing search index...

    Annotation for unwatching changes to a property and a getter

    When used as an annotation:

    • Combine with @observable, @computed or @nested (and their variants) to stop watching changes.
    • You cannot re-enable watching once @unwatch is specified.

    When used as a function:

    • Runs a piece of code without changes being detected by Watcher.
      unwatch(() => (model.field = "value"));
      
    • Warning: When used inside a transaction, it only becomes 'watching' when the outermost transaction completes.
      runInAction(() => {
      unwatch(() => {
      // isWatching === false
      });
      // isWatching === FALSE <-- already in a transaction
      unwatch(() => {
      // isWatching === false
      });
      });
      // isWatching === TRUE
    • Parameters

      • action: () => void

      Returns void

    • Parameters

      • target: object
      • propertyKey: string | symbol

      Returns void

    • Parameters

      • value: (this: object) => any
      • context: ClassGetterDecoratorContext

      Returns void | (this: object) => any

    • Parameters

      • value: ClassAccessorDecoratorTarget<object, any>
      • context: ClassAccessorDecoratorContext

      Returns void | ClassAccessorDecoratorResult<object, any>

    • Parameters

      • value: undefined
      • context: ClassFieldDecoratorContext<object, any>

      Returns any