Hi all,
In the document, only remove all listeners method.
Can I remove one handle in OnMessage?
Hi @BlueBang, this lacks documentation indeed.
I assume you're talking about the JavaScript client (colyseus.js
). Here's how you can remove the listener:
var callback = (message) => {/* ... */}
// attach listener
room.onMessage(callback);
// remove listener
room.onMessage.remove(callback);
Cheers!