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-25 11:31:58 +00:00
|
|
|
import * as NoAuthProbeStore from '../store/entity/noauth-probe';
|
2018-05-10 10:54:47 +00:00
|
|
|
|
|
|
|
import {
|
|
|
|
NoAuthProbe,
|
|
|
|
} from '@overflow/commons-typescript/model/noauth';
|
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class NoAuthProbeSubscriber {
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
private store: Store<NoAuthProbeStore.State>,
|
|
|
|
private loggerService: LoggerService,
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
|
|
|
|
@RPCSubscriber({method: 'NoAuthProbeService.onConnect'})
|
|
|
|
public onConnect(noAuthProbe: NoAuthProbe): void {
|
|
|
|
this.loggerService.debug('NoAuthProbeService.onConnect noAuthProbe:', noAuthProbe);
|
|
|
|
|
|
|
|
this.store.dispatch(new NoAuthProbeStore.OnConnect(noAuthProbe));
|
|
|
|
}
|
|
|
|
|
|
|
|
@RPCSubscriber({method: 'NoAuthProbeService.onDisconnect'})
|
|
|
|
public onDisconnect(noAuthProbe: NoAuthProbe): void {
|
|
|
|
this.loggerService.debug('NoAuthProbeService.onDisconnect noAuthProbe:', noAuthProbe);
|
|
|
|
|
|
|
|
this.store.dispatch(new NoAuthProbeStore.OnDisconnect(noAuthProbe));
|
|
|
|
}
|
|
|
|
}
|