Variable ConnectionContainerModuleConst

ConnectionContainerModule: symbol & {
    create(callback): ContainerModule;
} = ...

Connection Container Module

It provides bindings which are scoped per a connection, e.g. in order to allow backend services to access frontend service within the same connection.

Binding a frontend service

const myConnectionModule = ConnectionContainerModule.create(({ bindFrontendService }) => {
bindFrontendService(myFrontendServicePath, MyFrontendService);
});

export const myBackendApplicationModule = new ContainerModule(bind => {
bind(ConnectionContainerModule).toConstantValue(myConnectionModule);
}

Exposing a backend service

const myConnectionModule2 = ConnectionContainerModule.create(({ bind, bindBackendService }) => {
bind(MyBackendService).toSelf().inSingletonScope();
bindBackendService(myBackendServicePath, MyBackendService);
});

export const myBackendApplicationModule2 = new ContainerModule(bind => {
bind(ConnectionContainerModule).toConstantValue(myConnectionModule2);
}

Injecting a frontend service

@injectable()
export class MyBackendService {
@inject(MyFrontendService)
protected readonly myFrontendService: MyFrontendService;
}

Type declaration