Skip to content
This repository was archived by the owner on Dec 3, 2021. It is now read-only.

Added constants to fully comply to standard websocket#19

Open
hktonylee wants to merge 1 commit intoappuri:masterfrom
hktonylee:master
Open

Added constants to fully comply to standard websocket#19
hktonylee wants to merge 1 commit intoappuri:masterfrom
hktonylee:master

Conversation

@hktonylee
Copy link

No description provided.

@nathanboktae
Copy link
Contributor

I really don't want to maintain a typescript definition. Moreover it shouldn't matter, as one place may instantiate it knowing it is a RobustWebSocket but all other consumers treat it as a normal WebSocket instance and do not know the difference. That is also why the static constants were not put on RobustWebSocket. Not interested in taking this PR.

@hktonylee
Copy link
Author

That's fine to skip the Typescript definition. But the standard web socket has constants in the prototype. That means anyone can access the constants in both WebSocket.CLOSED and (new WebSocket()).CLOSED. Please check here.

In order to make it fully transparent, it is necessary to add the constants.

@nathanboktae
Copy link
Contributor

Oh I was not aware they were on the prototype too. If.you can scope the PR down to that we can take it.

@hktonylee
Copy link
Author

I have force-updated the branch. Please check ;-)

@hktonylee hktonylee changed the title Added TypeScript type definition, and make it fully complies to standard web socket Added constants to fully comply to standard websocket Aug 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants