Merge branch 'master' into combined-prs-branch
[poolifier.git] / examples / typescript / websocket-server-pool / ws-worker_threads / src / main.ts
index 0c1acba1b43bc1683261788b001c78c931c08c0c..d5b2cc78e8e4feda873602ea9b1074e581d3d8f9 100644 (file)
@@ -13,7 +13,7 @@ const emptyFunction = (): void => {
   /* Intentional */
 }
 
-wss.on('connection', (ws) => {
+wss.on('connection', ws => {
   ws.on('error', console.error)
   ws.on('message', (message: RawData) => {
     const { type, data } = JSON.parse(
@@ -24,28 +24,28 @@ wss.on('connection', (ws) => {
       case MessageType.echo:
         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:
         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