Skip to content

Fixed OTSubscriberEventHandlers type for connected member #798

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

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