Skip to content

Commit 8406369

Browse files
committed
fixed keyframes debouncing promise
1 parent 167072e commit 8406369

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

demo/@/components/custom/animation-controls/KeyframesStringControls.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -824,15 +824,17 @@ const highlightCSS = (el?: HTMLElement) => {
824824
pres.forEach(highlight);
825825
};
826826
827-
const updateAllStrings = debounce(async () => {
827+
const updateAllStrings = async () => {
828828
templateFrameStrings = [];
829829
830830
templateFrameStrings = await CSSKeyframesToStrings(animation);
831831
832832
const keyframesString = await updateCSSAnimationKeyframesStringFromAnimation();
833833
834834
return keyframesString;
835-
}, 100);
835+
};
836+
837+
const debouncedUpdateAllStrings = debounce(updateAllStrings, 100);
836838
837839
const updateAllStringsAndAnimation = async () => {
838840
const reversedKeyframesString = await updateAllStrings();
@@ -847,7 +849,7 @@ watch(
847849
);
848850
849851
watch(animation.templateFrames, async () => {
850-
updateAllStrings();
852+
debouncedUpdateAllStrings();
851853
});
852854
853855
watch(

0 commit comments

Comments
 (0)