Skip to main content

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.

Example

const name = atom('name', 'Bob')
react('greeting', () => {
whyAmIRunning()
console.log('Hello', name.value)
})

name.set('Alice')

// 'greeting' is running because:
// 'name' changed => 'Alice'

Signature

whyAmIRunning(): void;

Returns

void

Defined in: signia/src/capture.ts:148