aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lustre.ffi.mjs7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/lustre.ffi.mjs b/src/lustre.ffi.mjs
index 9abc107..b99f6e2 100644
--- a/src/lustre.ffi.mjs
+++ b/src/lustre.ffi.mjs
@@ -13,7 +13,6 @@ export class App {
#state = null;
#queue = [];
#effects = [];
- #willUpdate = false;
#didUpdate = false;
#init = null;
@@ -50,10 +49,8 @@ export class App {
}
dispatch(msg) {
- if (!this.#willUpdate) window.requestAnimationFrame(() => this.#tick());
-
this.#queue.push(msg);
- this.#willUpdate = true;
+ this.#tick();
}
emit(name, event = null) {
@@ -71,7 +68,6 @@ export class App {
this.#state = null;
this.#queue = [];
this.#effects = [];
- this.#willUpdate = false;
this.#didUpdate = false;
this.#update = () => {};
this.#view = () => {};
@@ -88,7 +84,6 @@ export class App {
this.#flush();
this.#didUpdate && this.#render();
this.#didUpdate = false;
- this.#willUpdate = false;
}
#flush(times = 0) {