refactor(timeout): move setTimeout to afterUpdate method

This commit is contained in:
Eric Liu 2019-12-25 06:21:09 -08:00
commit 2cac297abf
3 changed files with 23 additions and 22 deletions

View file

@ -11,10 +11,8 @@
let timeoutId = undefined;
onDestroy(() => {
if (timeoutId !== undefined) {
window.clearTimeout(timeoutId);
timeoutId = undefined;
}
window.clearTimeout(timeoutId);
timeoutId = undefined;
});
$: showFeedback = timeoutId !== undefined;