Skip to content

Instantly share code, notes, and snippets.

@ljmotta
Created October 14, 2020 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ljmotta/bced792e7e2778b7b2b4400c71ff6f1c to your computer and use it in GitHub Desktop.
Save ljmotta/bced792e7e2778b7b2b4400c71ff6f1c to your computer and use it in GitHub Desktop.
PingPongEnvelopeApiImpl
import { EnvelopeApiFactoryArgs } from "@kogito-tooling/envelope";
import { Association, PingPongChannelApi, PingPongEnvelopeApi, PingPongInitArgs } from "../api";
// ...
export class PingPongEnvelopeApiImpl implements PingPongEnvelopeApi {
constructor(
private readonly args: EnvelopeApiFactoryArgs<
PingPongEnvelopeApi,
PingPongChannelApi,
PingPongEnvelopeViewApi,
PingPongEnvelopeContext
>,
private readonly pingPongViewFactory: PingPongFactory
) {}
public async pingPongView__init(association: Association, initArgs: PingPongInitArgs) {
this.args.envelopeBusController.associate(association.origin, association.envelopeServerId);
const pingPong = this.pingPongViewFactory.create(initArgs, this.args.envelopeBusController.manager.clientApi);
await this.args.view().setView(pingPong)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment