Skip to content

Commit

Permalink
Code cleanup #26
Browse files Browse the repository at this point in the history
  • Loading branch information
tillias committed Oct 18, 2020
1 parent c8156cd commit 49a84e5
Showing 1 changed file with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CreateDependencyDialogService } from './create-dependency-dialog/create
import { JhiEventManager } from 'ng-jhipster';
import { forkJoin, Subscription } from 'rxjs';
import { MicroserviceService } from '../../entities/microservice/microservice.service';
import { map } from 'rxjs/operators';

@Component({
selector: 'jhi-dependency-dashboard',
Expand Down Expand Up @@ -106,12 +107,21 @@ export class DependencyDashboardComponent implements OnInit, AfterViewInit, OnDe
}

loadAll(): void {
const dependencies = this.dependencyService.query();
const microservices = this.microserviceService.query();

forkJoin([dependencies, microservices]).subscribe(results => {
this.refreshGraph(results[0].body || [], results[1].body || []);
});
const dependencies$ = this.dependencyService.query();
const microservices$ = this.microserviceService.query();

forkJoin({ dependencies$, microservices$ })
.pipe(
map(result => {
return {
dependencies: result.dependencies$.body || [],
microservices: result.microservices$.body || [],
};
})
)
.subscribe(results => {
this.refreshGraph(results.dependencies, results.microservices);
});
}

refreshGraph(dependencies: IDependency[], microservices: IMicroservice[]): void {
Expand Down

0 comments on commit 49a84e5

Please sign in to comment.