observer fix
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
54c381de8e
commit
4d874b5c9a
1 changed files with 2 additions and 2 deletions
|
@ -33,8 +33,8 @@ class Observer {
|
||||||
* @param {any} msg The message to send to the observers
|
* @param {any} msg The message to send to the observers
|
||||||
*/
|
*/
|
||||||
async emit(msg) {
|
async emit(msg) {
|
||||||
Promise.all(
|
return Promise.all(
|
||||||
Array.from(this._handlers).map((handler) => async () => {
|
Array.from(this._handlers).map(async (handler) => {
|
||||||
try {
|
try {
|
||||||
await handler(msg);
|
await handler(msg);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in a new issue