From 783b6ffe8c69ce34429e8620ebc03a5efeac92c0 Mon Sep 17 00:00:00 2001 From: Mimi <1119186082@qq.com> Date: Sun, 23 Aug 2020 14:36:34 +0800 Subject: [PATCH] Use `Array.flat` in motion.js --- source/js/motion.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/js/motion.js b/source/js/motion.js index 87f1d8f..02bcc9d 100644 --- a/source/js/motion.js +++ b/source/js/motion.js @@ -10,12 +10,11 @@ NexT.motion.integrator = { }, add(fn) { const sequence = fn(); - if (CONFIG.motion.async) this.queue.push(sequence); - else this.queue = this.queue.concat(sequence); + this.queue.push(sequence); return this; }, bootstrap() { - if (!CONFIG.motion.async) this.queue = [this.queue]; + if (!CONFIG.motion.async) this.queue = [this.queue.flat()]; this.queue.forEach(sequence => { const timeline = window.anime.timeline({ duration: 200,