smartuniverse/ts/smartuniverse.classes.clientuniversechannel.ts

36 lines
901 B
TypeScript
Raw Normal View History

import * as plugins from './smartuniverse.plugins';
2019-04-11 15:52:01 +00:00
import * as interfaces from './interfaces';
2019-04-11 15:52:01 +00:00
import { ClientUniverse } from './';
2019-04-11 15:52:01 +00:00
export class ClientUniverseChannel implements interfaces.IUniverseChannel {
// ======
// STATIC
// ======
public static async createClientUniverseChannel(
clientUniverseArg: ClientUniverse,
channelName: string
): Promise<ClientUniverseChannel> {
const clientChannel = new ClientUniverseChannel(clientUniverseArg);
await clientChannel.transmitSubscription();
return clientChannel;
}
// ========
// INSTANCE
// ========
public clientUniverse: ClientUniverse;
constructor(clientUniverseArg: ClientUniverse) {
this.clientUniverse = clientUniverseArg;
}
/**
* tells the universe about this instances interest into a channel
*/
public async transmitSubscription() {
this.clientUniverse.socketClient;
}
}