/** ***************************************** * Created by edonet@163.com * Created on 2021-08-15 11:47:32 ***************************************** */ 'use strict'; /** ***************************************** * 加载依赖 ***************************************** */ import { rAF } from './rAF'; /** ***************************************** * 下一帧 ***************************************** */ function nextTick(): Promise; function nextTick(callback: () => T): Promise; function nextTick(callback?: () => T): Promise; function nextTick(callback?: () => T): Promise { return new Promise(resolve => rAF(() => resolve(callback && callback()))); } /** ***************************************** * 抛出接口 ***************************************** */ export { nextTick };