refac
This commit is contained in:
1 parent
bb0e6cb108
commit
29f6c72e87
1 file changed
+9
-3
@@ -71,11 +71,17 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const updateHandler = (content) => {
|
const updateHandler = (content) => {
|
||||||
if (content && !pendingUpdate) {
|
if (content) {
|
||||||
pendingUpdate = requestAnimationFrame(() => {
|
if (done) {
|
||||||
|
cancelAnimationFrame(pendingUpdate);
|
||||||
pendingUpdate = null;
|
pendingUpdate = null;
|
||||||
parseTokens();
|
parseTokens();
|
||||||
});
|
} else if (!pendingUpdate) {
|
||||||
|
pendingUpdate = requestAnimationFrame(() => {
|
||||||
|
pendingUpdate = null;
|
||||||
|
parseTokens();
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user