sparkletown/sparkle

View on GitHub
src/components/templates/AnimateMap/vendors/playerio/PromissesWrappers/ProxyPlayerIO.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { PlayerIO } from "../PlayerIO";

import { ProxyClient } from "./ProxyClient";

export class ProxyPlayerIO {
  constructor(public originPlayerIO: PlayerIO) {}

  async authenticate(
    gameId: string,
    connectionId: string,
    authenticationArguments: object,
    playerInsightSegments: object = {}
  ) {
    return new Promise<ProxyClient>((resolve, reject) => {
      this.originPlayerIO.authenticate(
        gameId,
        connectionId,
        authenticationArguments,
        playerInsightSegments,
        (client) => resolve(new ProxyClient(client)),
        reject
      );
    });
  }
}