Skip to content

Type Alias: WatcherNotify

Documentation / @xmachines/play-signals / WatcherNotify

type WatcherNotify = () => void;

Defined in: packages/play-signals/src/types.ts:139

Notification callback for Signal.subtle.Watcher

Invoked when watched signals change. Use microtask batching pattern to coalesce rapid updates (see signal-polyfill README for best practices).

Returns

void

Example

import { Signal } from "@xmachines/play-signals";
const notify: WatcherNotify = () => {
queueMicrotask(() => {
const pending = watcher.getPending();
// Process pending signal changes
});
};
const watcher = new Signal.subtle.Watcher(notify);