-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add LiveObjectsPool to LiveObjects and naive implementation of `getRo…
…ot` method
- Loading branch information
Showing
4 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,21 @@ | ||
import type BaseClient from 'common/lib/client/baseclient'; | ||
import type RealtimeChannel from 'common/lib/client/realtimechannel'; | ||
import { LiveMap } from './livemap'; | ||
import { LiveObjectsPool, ROOT_OBJECT_ID } from './liveobjectspool'; | ||
|
||
export class LiveObjects { | ||
private _client: BaseClient; | ||
private _channel: RealtimeChannel; | ||
private _liveObjectsPool: LiveObjectsPool; | ||
|
||
constructor(channel: RealtimeChannel) { | ||
this._channel = channel; | ||
this._client = channel.client; | ||
this._liveObjectsPool = new LiveObjectsPool(this); | ||
} | ||
|
||
async getRoot(): Promise<LiveMap> { | ||
// TODO: wait for SYNC sequence to finish to return root | ||
return this._liveObjectsPool.get(ROOT_OBJECT_ID) as LiveMap; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters