watch(path, callback) {
      Logger.debug(`Watching path ${path} with callback`, callback);
      if (!this.watchers.has(path)) {
        this.watchers.set(path, /* @__PURE__ */ new Set());
      }
      this.watchers.get(path).add(callback);
      return () => {
        if (this.watchers.has(path)) {
          this.watchers.get(path).delete(callback);
        }
      };
    }
Watches for changes to the specified path in the state tree
and allows the addition of callbacks that execute when changes occur.

@param {string} path - The path in the state tree to watch for changes.
@param {Function} callback - A function to execute when the value at the path changes.
                               The callback receives the new and old values as parameters.

@returns {Function} A function to unsubscribe the callback from the watcher.