mirror of
https://github.com/vector-im/element-web.git
synced 2026-05-05 12:16:53 +02:00
improve typing
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
7da02b7901
commit
4885615a40
@ -33,7 +33,7 @@ export const useAccountData = <T extends {}>(cli: MatrixClient, eventType: strin
|
||||
}, [cli, eventType]);
|
||||
useEventEmitter(cli, "accountData", handler);
|
||||
|
||||
return value || {};
|
||||
return value || {} as T;
|
||||
};
|
||||
|
||||
// Hook to simplify listening to Matrix room account data
|
||||
@ -46,5 +46,5 @@ export const useRoomAccountData = <T extends {}>(room: Room, eventType: string)
|
||||
}, [room, eventType]);
|
||||
useEventEmitter(room, "Room.accountData", handler);
|
||||
|
||||
return value || {};
|
||||
return value || {} as T;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user