You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In order to create the provider, there are three overloads for it. In a nutshell, one can pass one (or more) websocket `uri`s with its optional supported protocols. For example:
34
+
In order to create the provider, there are four overloads for it. In a nutshell, one can pass one (or more) websocket `uri`s with its optional supported protocols. For example:
- `CONNECTING`: The connection is still being opened. It includes which socket and protocols is trying to connect to.
80
+
- `CONNECTING`: The connection is still being opened. It includes which socket and protocols is trying to connect to. The connection will be attempted for the time set in `timeout` option, defaulting to 3.5 seconds. Afterwards, in case it didn't succeed, it will go to `ERROR` status and proceed as if it was any other error.
75
81
- `CONNECTED`: The connection has been established and is currently open. It includes which socket and protocols is trying to connect to.
76
82
- `ERROR`: The connection had an error. The provider will try to reconnect to other websockets (if available) or the same one. It includes the event sent by the server.
77
83
- `CLOSE`: The connection closed. If the server was the one closing the connection, the provider will try to reconnect to other websockets (if available) or the same one. It includes the event sent by the server.
78
84
79
85
`provider.getStatus()` returns the current status.
80
86
81
-
When creating the provider, the consumer can pass a callback that will be called every time the status changes:
87
+
When creating the provider, the consumer can pass a callback (`onStatusChanged`) that will be called every time the status changes:
0 commit comments