Skip to content

Conversation

gguidotti
Copy link

This PR fixes an incorrect type for the connected event in OTSubscriberEventHandlers.
Given the following code:

const subscriberEventHandlers: OTSubscriberEventHandlers = useMemo(
  () => ({
    connected: (event) => {
      console.log('connected', event)
    }
  }),
  []
)

TypeScript throws the warning: Parameter 'event' implicitly has an 'any' type.

However, when logging the event, I noticed that it adheres to the Stream type. I've updated the library types accordingly to eliminate the warning.
I suspect the same applies to the disconnected event, but since I couldn't see it fire in my code I haven't updated it (I wasn't sure about the type for this event).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant