-
I am integrating RxJS with SignalR. SignalR has this type called I tried to pass the instance of The issue is that Typescript won't allow that, because export interface JQueryStyleEventEmitter {
on: (eventName: string, handler: Function) => void;
off: (eventName: string, handler: Function) => void;
} Whereas the connections' on(methodName: string, newMethod: (...args: any[]) => void): void; Typescript complains about type Any advise, anyone, please? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yep... it seems like there's something missmatching on the types of Function. However, you have an easy workaround by using const fromSignalREvent = (connection: HubConnection, eventName: string) =>
fromEventPattern(
handler => connection.on(eventName, handler),
handler => connection.off(eventName, handler)
) |
Beta Was this translation helpful? Give feedback.
Yep... it seems like there's something missmatching on the types of Function.
However, you have an easy workaround by using
fromEventPattern
: