beat
链上短暂停顿符号,使后续操作与前面的操作串行执行。
基本用法
并行执行(默认)
figure.fadeIn().speak`你好!`; // fadeIn 和 speak 同时执行使用 beat 串行执行
figure.fadeIn().beat.speak`你好!`; // 先 fadeIn,然后 speak
// 等价于
figure.fadeIn()
figure.speak`你好`适用场景
当你需要简短的串行分割,不需要额外等待时间。
对比
- beat 与 then:beat 是短暂停顿符号;then 等待前一组操作完成后立即执行
- beat 与 next(ms):beat 不引入延迟;next 引入毫秒级延迟
Last updated on