presenceState()
presenceState<T = Record<string, any>>(): RealtimePresenceState<T>
返回当前频道的 Presence 快照,键为 Presence key。
const state = channel.presenceState();
// { "user-1": [{ user_id: 1, name: "Ada" }] }
presenceState<T = Record<string, any>>(): RealtimePresenceState<T>
返回当前频道的 Presence 快照,键为 Presence key。
const state = channel.presenceState();
// { "user-1": [{ user_id: 1, name: "Ada" }] }