From 726a5b931104260ad17c3cf08d5a40c903fced97 Mon Sep 17 00:00:00 2001 From: Hayleigh Thompson Date: Sun, 23 Jul 2023 19:37:57 +0100 Subject: :bug: Fixed a bug where effects were passed a dispatch function with an unbound 'this'. --- src/lustre.ffi.mjs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lustre.ffi.mjs b/src/lustre.ffi.mjs index 2ebb0a9..9abc107 100644 --- a/src/lustre.ffi.mjs +++ b/src/lustre.ffi.mjs @@ -104,8 +104,9 @@ export class App { // Each update can produce effects which must now be executed. while (this.#effects[0]) - this.#effects.shift()(this.dispatch, (name, data) => - this.emit(name, data) + this.#effects.shift()( + (msg) => this.dispatch(msg), + (name, data) => this.emit(name, data) ); // Synchronous effects will immediately queue a message to be processed. If -- cgit v1.2.3