observer fix

Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
Victor Seiji Hariki 2022-11-28 12:25:31 -03:00
parent 54c381de8e
commit 4d874b5c9a

View file

@ -33,8 +33,8 @@ class Observer {
* @param {any} msg The message to send to the observers
*/
async emit(msg) {
Promise.all(
Array.from(this._handlers).map((handler) => async () => {
return Promise.all(
Array.from(this._handlers).map(async (handler) => {
try {
await handler(msg);
} catch (e) {