@optiaxiom/globals 0.7.5 → 1.0.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/dist/cjs/index.js +4 -1
- package/dist/esm/toaster.js +4 -1
- package/package.json +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -70,9 +70,12 @@ const createToaster = () => {
|
|
|
70
70
|
};
|
|
71
71
|
};
|
|
72
72
|
const waitForAnimation = async (element) => {
|
|
73
|
+
if (!element) {
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
73
76
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
74
77
|
await Promise.allSettled(
|
|
75
|
-
typeof element
|
|
78
|
+
typeof element.getAnimations === "function" ? element.getAnimations().map((animation) => animation.finished) : [Promise.resolve()]
|
|
76
79
|
);
|
|
77
80
|
};
|
|
78
81
|
const toaster = createToaster();
|
package/dist/esm/toaster.js
CHANGED
|
@@ -59,9 +59,12 @@ const createToaster = () => {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
const waitForAnimation = async (element) => {
|
|
62
|
+
if (!element) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
62
65
|
await new Promise((resolve) => requestAnimationFrame(resolve));
|
|
63
66
|
await Promise.allSettled(
|
|
64
|
-
typeof element
|
|
67
|
+
typeof element.getAnimations === "function" ? element.getAnimations().map((animation) => animation.finished) : [Promise.resolve()]
|
|
65
68
|
);
|
|
66
69
|
};
|
|
67
70
|
const toaster = createToaster();
|