(evt)
| 24 | ws.id = id |
| 25 | ws.once = (callack, id) => { |
| 26 | const func = (evt) => { |
| 27 | const arg = JSON.parse(evt.data) |
| 28 | if (id === arg.id) { |
| 29 | callack(arg) |
| 30 | ws.removeEventListener('message', func) |
| 31 | } |
| 32 | } |
| 33 | ws.addEventListener('message', func) |
| 34 | } |
| 35 | ws.onclose = () => { |
no test coverage detected