runQueue
runQueue():
void
Defined in: aberdeen.ts:111
Forces the immediate and synchronous execution of all pending reactive updates.
Normally, changes to observed data sources (like proxied objects or arrays) are processed asynchronously in a batch after a brief timeout (0ms). This function allows you to bypass the timeout and process the update queue immediately.
This can be useful in specific scenarios where you need the DOM to be updated synchronously.
This function is re-entrant, meaning it is safe to call runQueue from within
a function that is itself being executed as part of an update cycle triggered
by a previous (or the same) runQueue call.
Returns
Section titled “Returns”void
Example
Section titled “Example”const $data = A.proxy("before");
A('#', $data);console.log(1, document.body.innerHTML); // before
// Make an update that should cause the DOM to change.$data.value = "after";
// Normally, the DOM update would happen after a timeout.// But this causes an immediate update:A.runQueue();
console.log(2, document.body.innerHTML); // after