@studiometa/js-toolkit 2.2.0-alpha.0 → 2.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@studiometa/js-toolkit",
3
- "version": "2.2.0-alpha.0",
3
+ "version": "2.2.0-alpha.1",
4
4
  "description": "A set of useful little bits of JavaScript to boost your project! 🚀",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -27,6 +27,7 @@ function getScheduler(steps) {
27
27
  const stepsFns = {};
28
28
  const api = {};
29
29
  let isScheduled = false;
30
+ const resolvedPromise = Promise.resolve();
30
31
  function run(tasks) {
31
32
  let task;
32
33
  while (task = tasks.shift()) {
@@ -47,7 +48,7 @@ function getScheduler(steps) {
47
48
  return;
48
49
  }
49
50
  isScheduled = true;
50
- requestAnimationFrame(flush);
51
+ resolvedPromise.then(flush);
51
52
  }
52
53
  steps.forEach((step) => {
53
54
  stepsFns[step] = [];
@@ -2,6 +2,7 @@ function getScheduler(steps) {
2
2
  const stepsFns = {};
3
3
  const api = {};
4
4
  let isScheduled = false;
5
+ const resolvedPromise = Promise.resolve();
5
6
  function run(tasks) {
6
7
  let task;
7
8
  while (task = tasks.shift()) {
@@ -22,7 +23,7 @@ function getScheduler(steps) {
22
23
  return;
23
24
  }
24
25
  isScheduled = true;
25
- requestAnimationFrame(flush);
26
+ resolvedPromise.then(flush);
26
27
  }
27
28
  steps.forEach((step) => {
28
29
  stepsFns[step] = [];