import { EMPTY_ARRAY, EffectScheduler } from '@tldraw/state' import { useEffect } from 'react' /** * A React hook that runs side effects immediately in response to signal changes, without throttling. * Unlike useReactor which batches updates to animation frames, useQuickReactor executes the effect * function immediately when dependencies change, making it ideal for critical updates that cannot wait. * * The effect runs immediately when the component mounts and whenever tracked signals change. * Updates are not throttled, so the effect executes synchronously on every change. * * @example * ```ts * function DataSynchronizer() { * const criticalData = useAtom('criticalData', null) * * useQuickReactor('sync-data', () => { * const data = criticalData.get() * if (data) { * // Send immediately - don't wait for next frame * sendToServer(data) * } * }, [criticalData]) * * return