mirror of
https://github.com/element-hq/element-web
synced 2024-11-24 10:15:43 +03:00
Fix useEventEmitter to support passing all callback arguments
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
37d04d6ceb
commit
02ddda587b
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ export const useEventEmitter = (emitter, eventName, handler) => {
|
|||
if (!emitter) return;
|
||||
|
||||
// Create event listener that calls handler function stored in ref
|
||||
const eventListener = event => savedHandler.current(event);
|
||||
const eventListener = (...args) => savedHandler.current(...args);
|
||||
|
||||
// Add event listener
|
||||
emitter.on(eventName, eventListener);
|
||||
|
|
Loading…
Reference in a new issue