mirror of
https://github.com/vector-im/element-web.git
synced 2024-11-16 05:04:57 +08: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…
Reference in New Issue
Block a user