Document connection.close and connection.bindToSocket
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6.5k
- Forks
- 456
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 5
Description
I learned from @houshuang that it's possible to manage reconnection as follows:
window.disconnect = function() {
connection.close();
};
window.connect = function() {
var socket = new WebSocket('ws://' + window.location.host);
connection.bindToSocket(socket);
};
Context https://github.com/houshuang/presence-demo/blob/master/client.js#L55
I find this feature quite useful for managing reconnections. It would be great to document it.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the reconnection example in client.js around line 55 and inspect how connection.close and connection.bindToSocket are exposed. Update the relevant API documentation to explain this disconnect/reconnect flow, including the WebSocket example, and consider the work done when both methods and their use for reconnection are clearly documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100