member_webapp/@overflow/noauth-probe/subscriber/noauth-probe.subscriber.ts
crusader e8ad7b6716 ing
2018-05-31 16:38:44 +09:00

34 lines
1.0 KiB
TypeScript

import { Injectable } from '@angular/core';
import { Store, select } from '@ngrx/store';
import { RPCSubscriber } from '@loafer/ng-rpc';
import { LoggerService } from '@loafer/ng-logger';
import { NoAuthProbe } from '@overflow/commons-typescript/model/noauth';
import * as NoAuthProbeConnectingStore from '../store/connecting';
@Injectable()
export class NoAuthProbeSubscriber {
public constructor(
private store: Store<any>,
private loggerService: LoggerService,
) {
}
@RPCSubscriber({method: 'NoAuthProbeService.onConnect'})
public onConnect(noAuthProbe: NoAuthProbe): void {
this.loggerService.debug('NoAuthProbeService.onConnect noAuthProbe:', noAuthProbe);
this.store.dispatch(new NoAuthProbeConnectingStore.OnConnect(noAuthProbe));
}
@RPCSubscriber({method: 'NoAuthProbeService.onDisconnect'})
public onDisconnect(noAuthProbe: NoAuthProbe): void {
this.loggerService.debug('NoAuthProbeService.onDisconnect noAuthProbe:', noAuthProbe);
this.store.dispatch(new NoAuthProbeConnectingStore.OnDisconnect(noAuthProbe));
}
}