()
| 189 | } |
| 190 | |
| 191 | function connect() { |
| 192 | if (process.env.NODE_ENV === 'test') return; |
| 193 | const connection = store.getState().connection; |
| 194 | try { |
| 195 | socket = socketCluster.create(connection.options); |
| 196 | handleConnection(); |
| 197 | } catch (error) { |
| 198 | store.dispatch({ type: actions.CONNECT_ERROR, error: error as Error }); |
| 199 | store.dispatch( |
| 200 | showNotification((error as Error).message || (error as string)) |
| 201 | ); |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | function disconnect() { |
| 206 | if (socket) { |
no test coverage detected