improve typing

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
Michael Telatynski 2020-06-25 16:55:38 +01:00
parent 7da02b7901
commit 4885615a40

View File

@ -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;
};