Closed gnowoel closed 7 years ago
From the docs, the signature of the hoodie.trigger() method is:
hoodie.trigger()
hoodie.trigger(eventName[, option1, option2, ...])
However, the optional arguments are simply ignored in the implementation:
state.emitter.emit(eventName)
In effect, when we trigger a custom event with:
hoodie.trigger('name', object);
The passed-in object will always be undefined in the event handler:
object
undefined
hoodie.on('name', (object) => { console.log(object); //=> undefined });
You are right 👍 That’s a proper bug. Would you mind sending a pull request to fix it? Happy to assist if you have any questions
Sure, would be glad to help :)
From the docs, the signature of the
hoodie.trigger()
method is:However, the optional arguments are simply ignored in the implementation:
In effect, when we trigger a custom event with:
The passed-in
object
will always beundefined
in the event handler: