GameRoom.onMessage() method

listen to incoming messages from the server

Signature:

onMessage(type: string | number, listener: (data: any) => void): () => void;

Parameters

Parameter

Type

Description

type

string | number

listener

(data: any) => void

**Returns:**

() => void