mirror of https://github.com/vector-im/riot-web
Fix useEventEmitter to support passing all callback arguments
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>pull/21833/head
parent
37d04d6ceb
commit
02ddda587b
|
@ -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 New Issue