module@warp-drive/alien-signals/primitives
Function isTracking() sincev5.10.0
ts
function isTracking(): boolean;Defined in: primitives.ts:360
Whether a memo's function is running, which means any signal or memo read now becomes one of its dependencies.
A framework integration can use this to skip work for reads it doesn't need to observe directly: when a watched memo reads a signal, the watcher already learns about changes to that signal through the memo.
Returns
boolean
true while a memo's function is running
Example
ts
import { consumeSignal, isTracking } from '@warp-drive/alien-signals/primitives';
function consume(signal) {
if (!isTracking()) watchInCurrentComponent(signal);
consumeSignal(signal);
}