How to use the vsls/vscode.getApiAsync function in vsls

To help you get started, we’ve selected a few vsls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vsls-contrib / chat / src / vsls / index.ts View on Github external
async connect(): Promise {
    this.liveshare = await vsls.getApiAsync();
    const { id: sessionId } = this.liveshare.session;

    this.liveshare.onDidChangePeers(({ added, removed }) => {
      if (!!this.hostService) {
        this.hostService.updateCachedPeers(added, removed);
      }

      const { role } = this.liveshare.session;

      if (role === vsls.Role.Host) {
        this.hostService.sendJoinedMessages(added);
        this.hostService.sendLeavingMessages(removed);
      }
    });

    this.liveshare.onDidChangeSession(async ({ session }) => {

vsls

Enables VS Code extensions to access Live Share capabilities.

CC-BY-4.0
Latest version published 3 years ago

Package Health Score

63 / 100
Full package analysis