Preparing search index...

    Function runWhenIdle

    • Schedules callback to run when the JS thread is idle.

      The callback is enqueued at the scheduler's idle priority: it runs only once higher-priority work (renders, gestures, transitions) has drained, and the scheduler yields back to that work if it arrives mid-flush. Always pair with cancelIdle to release work that is no longer needed — e.g. on unmount or when its input changes.

      Parameters

      • callback: () => void

        Work to run during idle time

      Returns CallbackNode

      Handle that cancels the scheduled work via cancelIdle