2018-05-10 10:54:47 +00:00
|
|
|
import { Injectable } from '@angular/core';
|
|
|
|
import { Store, select } from '@ngrx/store';
|
|
|
|
|
2018-05-24 06:44:13 +00:00
|
|
|
import { RPCSubscriber } from '@loafer/ng-rpc';
|
|
|
|
import { LoggerService } from '@loafer/ng-logger';
|
2018-05-10 10:54:47 +00:00
|
|
|
|
2018-05-31 07:38:44 +00:00
|
|
|
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
|
2018-05-10 10:54:47 +00:00
|
|
|
|
2018-05-31 07:38:44 +00:00
|
|
|
import * as NoAuthProbeConnectingStore from '../store/connecting';
|
2018-05-10 10:54:47 +00:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class NoAuthProbeSubscriber {
|
|
|
|
|
|
|
|
public constructor(
|
2018-05-28 11:16:00 +00:00
|
|
|
private store: Store<any>,
|
2018-05-10 10:54:47 +00:00
|
|
|
private loggerService: LoggerService,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
|
|
|
@RPCSubscriber({method: 'NoAuthProbeService.onConnect'})
|
|
|
|
public onConnect(noAuthProbe: NoAuthProbe): void {
|
|
|
|
this.loggerService.debug('NoAuthProbeService.onConnect noAuthProbe:', noAuthProbe);
|
|
|
|
|
2018-05-31 07:38:44 +00:00
|
|
|
this.store.dispatch(new NoAuthProbeConnectingStore.OnConnect(noAuthProbe));
|
2018-05-10 10:54:47 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@RPCSubscriber({method: 'NoAuthProbeService.onDisconnect'})
|
|
|
|
public onDisconnect(noAuthProbe: NoAuthProbe): void {
|
|
|
|
this.loggerService.debug('NoAuthProbeService.onDisconnect noAuthProbe:', noAuthProbe);
|
|
|
|
|
2018-05-31 07:38:44 +00:00
|
|
|
this.store.dispatch(new NoAuthProbeConnectingStore.OnDisconnect(noAuthProbe));
|
2018-05-10 10:54:47 +00:00
|
|
|
}
|
|
|
|
}
|