mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
So that it can be used by the end users:
```ts
const myMiddleware = ([eventName, ...args]: Event, next: (err?: Error) => void) => {
console.log(eventName); // inferred as string
next();
}
io.on("connection", (socket) => {
socket.use(myMiddleware);
});
```