This repository was archived by the owner on May 5, 2020. It is now read-only.
This repository was archived by the owner on May 5, 2020. It is now read-only.
Add subscriptions for connection opened and connection closed. #14
Open
Description
I believe this would solve #10
There are a number of reasons we would want to know when a connection is established or closed:
- Provide connection indicator in the UI
- Perform websocket specific authentication
Hypothetical not-well-vetted API:
type RetryInfo
= NoRetry -- Will not attempt to re-establish the connection
| RetryIn Int -- Will attempt to re-establish the connection in the specified number of seconds
type alias ConnectionClosedHandler msg
= String -- Connection URI
-> Int -- CloseEvent code
-> RetryInfo -- Retry information
-> msg
connectionClosed : ConnectionClosedHandler -> Sub msg
connectionOpened : (String -> msg) -> Sub msg
I wouldn't mind taking a stab at implementing this, assuming I can get some feedback on the proposed API.
Metadata
Metadata
Assignees
Labels
No labels