From 5f66df2782f7c6c967232c4f54fc946d9049e07f Mon Sep 17 00:00:00 2001 From: Priyanshu Date: Thu, 11 Jun 2026 09:37:44 +0000 Subject: [PATCH] docs: clarify server.on() and server.emit() are aliases for main namespace (fixes #4608) --- docs/server-api.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/server-api.md b/docs/server-api.md index 5b01bb40..f0751afe 100644 --- a/docs/server-api.md +++ b/docs/server-api.md @@ -366,7 +366,7 @@ See [here](categories/02-Server/server-instance.md#utility-methods). - `args` `any[]` - **Returns** `true` -Emits an event to all connected clients in the main namespace. +Alias for [`io.of("/").emit()`](#namespaceemiteventname-args). Emits an event to all connected clients in the main namespace. ```js io.emit("hello"); @@ -593,7 +593,7 @@ io.of((name, query, next) => { - `listener` [``](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function) - **Returns** [``](#server) -Adds the `listener` function to the end of the listeners array for the event named `eventName`. +Alias for [`io.of("/").on(eventName, listener)`](#namespaceon). Adds the `listener` function to the end of the listeners array for the event named `eventName`. Available events: