webSocketListener

Importing

import { webSocketListener } from '@marblejs/websockets';

Type declaration

webSocketListener :: WebSocketListenerConfig -> WebSocket.ServerOptions -> ContextReader

Parameters

WebSocketListenerConfig

Example

websocket.listener.ts
import { webSocketListener } from '@marblejs/websockets';
import { example$ } from './example.effect';
import { logger$ } from './logger.middleware';

export default webSocketListener({
  middlewares: [logger$],
  effects: [add$],
});

Last updated