Skip to content

Commit f2ef675

Browse files
committed
Switch to queueMicrotask
1 parent 1e73bc0 commit f2ef675

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

src/component.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,6 @@ let rerenderQueue = [];
189189

190190
let prevDebounce;
191191

192-
const defer =
193-
typeof Promise == 'function'
194-
? Promise.prototype.then.bind(Promise.resolve())
195-
: setTimeout;
196-
197192
/**
198193
* Enqueue a rerender of a component
199194
* @param {Component} c The component to rerender
@@ -207,7 +202,7 @@ export function enqueueRender(c) {
207202
prevDebounce !== options.debounceRendering
208203
) {
209204
prevDebounce = options.debounceRendering;
210-
(prevDebounce || defer)(process);
205+
(prevDebounce || queueMicrotask)(process);
211206
}
212207
}
213208

0 commit comments

Comments
 (0)