Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Latest
method Namespace.prototype.except
import { Namespace } from "https://deno.land/x/socket_io@0.2.0/packages/socket.io/lib/namespace.ts";

Excludes a room when emitting.

Examples

const myNamespace = io.of("/my-namespace");

// the "foo" event will be broadcast to all connected clients, except the ones that are in the "room-101" room myNamespace.except("room-101").emit("foo", "bar");

// with an array of rooms myNamespace.except(["room-101", "room-102"]).emit("foo", "bar");

// with multiple chained calls myNamespace.except("room-101").except("room-102").emit("foo", "bar");

Parameters

room: Room | Room[]
  • a room, or an array of rooms

Returns

BroadcastOperator<EmitEvents, SocketData>

a new BroadcastOperator instance for chaining