diff --git a/src/Space.ts b/src/Space.ts index d0d041fb..2e505dee 100644 --- a/src/Space.ts +++ b/src/Space.ts @@ -87,10 +87,7 @@ class Space extends EventEmitter { */ readonly client: RealtimeClient; private readonly channelName: string; - /** - * @internal - */ - readonly connectionId: string | undefined; + /** * The options passed to {@link default.get | `Spaces.get()`}. */ @@ -126,7 +123,6 @@ class Space extends EventEmitter { this.client = client; this.options = this.setOptions(options); - this.connectionId = this.client.connection.id; this.name = name; this.channelName = `${name}${SPACE_CHANNEL_TAG}`; @@ -140,6 +136,13 @@ class Space extends EventEmitter { this.locks = new Locks(this, this.presenceUpdate); } + /** + * @internal + */ + get connectionId(): string | undefined { + return this.client.connection.id; + } + private presenceUpdate = ({ data, extras }: SpacePresenceData) => { if (!extras) { return this.channel.presence.update(data);