Skip to content
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

Types: on* callbacks can be null #392

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Types: on* callbacks can be null #392

merged 1 commit into from
Feb 10, 2025

Conversation

th-we
Copy link
Contributor

@th-we th-we commented Feb 1, 2025

The callbacks are initialized to null:

this._onopen = null;
this._onmessage = null;
this._onerror = null;
this._onclose = null;

This should be reflected in the type declarations.

index.d.ts Outdated
onopen: (event: Event) => void | null;
onerror: (event: Event) => void | null;
onclose: (event: CloseEvent) => void | null;
onmessage: (event: MessageEvent) => void | null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be wrapped, as currently it related to the return type:

((event: MessageEvent) => void) | null

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, of course! I scrapped that commit and pushed a new one. Thanks!

@Atrue Atrue merged commit 4485ed0 into thoov:master Feb 10, 2025
0 of 6 checks passed
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.

2 participants