platform
    Preparing search index...

    Function waitForAsync

    • 조건이 만족될 때까지 비동기 대기

      Type Parameters

      • T

      Parameters

      • checkCondition: () => T | null

        조건 체크 함수 (null이 아닌 값을 반환하면 성공)

      • options: WaitForAsyncOptions = {}

        타임아웃 및 인터벌 옵션

      Returns Promise<T | null>

      조건이 만족되면 결과 값, 타임아웃되면 null

      timeoutMs나 intervalMs가 유효하지 않은 경우

      const element = await waitForAsync(() => document.querySelector('.modal'), { timeoutMs: 3000 });