Skip to content

Commit

Permalink
Use Array.flat in motion.js
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenjoezhang committed May 12, 2024
1 parent 5c02480 commit 783b6ff
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/js/motion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 783b6ff

Please sign in to comment.