)
})
- WebSocketServerWorker.wss.on('connection', (ws) => {
+ WebSocketServerWorker.wss.on('connection', ws => {
ws.on('error', console.error)
ws.on('message', (message: RawData) => {
const { type, data } = JSON.parse(
case MessageType.echo:
WebSocketServerWorker.requestHandlerPool
.execute({ data }, 'echo')
- .then((response) => {
+ .then(response => {
ws.send(
JSON.stringify({
type: MessageType.echo,
data: response.data
})
)
- return null
+ return undefined
})
.catch(emptyFunction)
break
case MessageType.factorial:
WebSocketServerWorker.requestHandlerPool
.execute({ data }, 'factorial')
- .then((response) => {
+ .then(response => {
ws.send(
JSON.stringify({
type: MessageType.factorial,
data: response.data
})
)
- return null
+ return undefined
})
.catch(emptyFunction)
break