Retree - v1.0.0
    Preparing search index...

    Function ignore

    • Field decorator that excludes a property of a ReactiveNode from Retree's reactivity system.

      Parameters

      • _value: undefined
      • context: ClassFieldDecoratorContext

      Returns void | ((this: ReactiveNode, value: any) => any)

      Reads and writes to the ignored field still work normally, but:

      • The proxy will not wrap the field's value or build child proxies underneath it, so nested mutations (e.g. this.ignored.count = 1) do not emit nodeChanged / treeChanged listeners on the parent.
      • Replacing the field at the top level (e.g. this.ignored = {...}) likewise skips listener emission.

      Use this for state that lives on a ReactiveNode but should not participate in the tree — caches, scratch buffers, framework handles, references to objects already managed elsewhere, etc.

      import { Retree, ReactiveNode, ignore } from "@retreejs/core";

      class Counter extends ReactiveNode {
      public count = 0;
      // Mutations to `cache` do not trigger Retree listeners.
      @ignore public cache: Record<string, unknown> = {};

      get dependencies() { return []; }
      }

      const node = Retree.root(new Counter());
      Retree.on(node, "nodeChanged", () => console.log("changed"));
      node.cache.something = 1; // ❌ no log
      node.count = 1; // ✅ logs "changed"