()
| 120 | if (process.env.REACT_STATIC_ENV === 'development') { |
| 121 | const io = require('socket.io-client') |
| 122 | const run = async () => { |
| 123 | try { |
| 124 | const socket = io() |
| 125 | socket.on('connect', () => { |
| 126 | // Do nothing |
| 127 | }) |
| 128 | socket.on('message', ({ type }) => { |
| 129 | if (type === 'reloadClientData') { |
| 130 | reloadClientData() |
| 131 | } |
| 132 | }) |
| 133 | } catch (err) { |
| 134 | console.log( |
| 135 | 'React-Static data hot-loader websocket encountered the following error:' |
| 136 | ) |
| 137 | console.error(err) |
| 138 | } |
| 139 | } |
| 140 | run() |
| 141 | } |
| 142 |
no test coverage detected