untracked<R> static method

R untracked<R>(
  1. R action()
)

Runs action with dependency tracking suspended: any observable read inside action is not registered as a dependency of whatever Observer/Computed/effect is currently tracking, even though that outer context remains active underneath. Supports nesting (only the outermost call needs to restore suspension). Powers the top-level untracked() function and Observable.peek().

Executa action com o rastreamento de dependências suspenso: qualquer observável lido dentro de action não é registrado como dependência do Observer/Computed/effect que estiver rastreando no momento, mesmo que esse contexto externo continue ativo por baixo. Suporta aninhamento (apenas a chamada mais externa precisa restaurar a suspensão). Alimenta a função untracked() de nível superior e Observable.peek().

Implementation

static R untracked<R>(R Function() action) {
  _suspendDepth++;
  try {
    return action();
  } finally {
    _suspendDepth--;
  }
}