• 使用promise实现的nextTick

    返回 Promise<void>

    nextTick().then(() => {
    // do something
    });

    // or

    await nextTick();
    // do something
  • 使用promise实现的nextTick

    参数

    • then: (() => unknown)
        • (): unknown
        • 返回 unknown

    返回 (() => void)

      • (): void
      • 返回 void

    const abort = nextTick(() => {
    // do something
    });
    abort(); // abort