Skip to main content

watchedSignal

function

Create a Signal that will subscribe to a value from an external store when watched, similar to React's [useSyncExternalStore](https://react.dev/reference/react/useSyncExternalStore).

function watchedSignal<T>(getSnapshot: () => T, register: (self: Signal<T>) => () => void): Signal<T>

Import

import { watchedSignal } from '@modular/sdk/editor';

Notes

returns
The signal