This commit is contained in:
crusader
2018-05-31 21:44:11 +09:00
parent e46aa26170
commit 87f68ca3f3
4 changed files with 28 additions and 47 deletions

View File

@@ -6,9 +6,10 @@ import { Anim } from './animation';
import { Store, select } from '@ngrx/store';
import { Observable, of, Subscription } from 'rxjs';
import { DiscoveryService } from '../service/discovery.service';
import { DiscoveryNotify } from '../core/discovery-subject';
import { DiscoveryNotify } from '../subscriber/discovery.subscriber.subject';
import { catchError, exhaustMap, map, tap } from 'rxjs/operators';
import { DiscoverZone, Zone, Host, Port, Service } from '@overflow/commons-typescript/model/discovery';
import { DiscoverySubscriber } from '../subscriber/discovery.subscriber';
@Component({
selector: 'of-discovery',
@@ -28,6 +29,7 @@ export class DiscoveryComponent {
constructor(
private discoveryService: DiscoveryService,
private discoverySubscriber: DiscoverySubscriber,
private store: Store<any>
) {
}
@@ -37,7 +39,12 @@ export class DiscoveryComponent {
this.requested = true;
this.discoverySubscription = this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz).pipe(
const discovery$ = this.discoverySubscriber.subscribe();
discovery$.pipe(
tap(() => {
this.discoveryService.discoverZone(this.selectedProbe.probe.probeKey, dz);
}),
map((discoveryNotify: DiscoveryNotify) => {
switch (discoveryNotify.method) {
case 'DiscoveryService.discoveryStart': {