API ReferenceCgameclientOnstateCGameClient.onState() method Signature: onState(cb: (state: S) => void): () => void; Parameters Parameter Type Description cb (state: S) => void **Returns:** () => void