whyAmIRunning

See source code

A debugging tool that tells you why a computed signal or effect is running. Call in the body of a computed signal or effect function. Nothing is logged for the run that calls it; from the next run on, each run logs the ancestors that changed.

function whyAmIRunning(): void;

Example

const name = atom("name", "Bob");
react("greeting", () => {
  whyAmIRunning();
  print("Hello", name.get());
});

name.set("Alice");

// Effect(greeting) is executing because:
//   Atom(name) changed
Prev
unsafe__withoutCapture
Next
withDiff