whyAmIRunning
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) changedPrev
unsafe__withoutCaptureNext
withDiff