Turn off the accepted rules and fix the design tokens, alt text, and last type errors. [skip build]
This commit is contained in:
@@ -7,8 +7,12 @@ export type StateEventCallback = (
|
||||
lastStateEvent: MatrixEvent | null,
|
||||
) => void;
|
||||
|
||||
export const useStateEventCallback = (mx: MatrixClient, onStateEvent: StateEventCallback) => {
|
||||
export const useStateEventCallback = (
|
||||
mx: MatrixClient | undefined,
|
||||
onStateEvent: StateEventCallback,
|
||||
) => {
|
||||
useEffect(() => {
|
||||
if (!mx) return undefined;
|
||||
mx.on(RoomStateEvent.Events, onStateEvent);
|
||||
return () => {
|
||||
mx.removeListener(RoomStateEvent.Events, onStateEvent);
|
||||
|
||||
Reference in New Issue
Block a user