import { Component, EventEmitter, inject, Output } from '@angular/core'; import { finalize, forkJoin } from 'rxjs'; import images from 'src/assets/images'; import { PosInfoStore, PosProfileStore } from '../store'; import { DeviceInfoStore } from '../store/device.store'; @Component({ selector: 'pos-splash', templateUrl: 'splash.component.html', }) export class PosSplashComponent { @Output() onComplete = new EventEmitter(); private readonly posProfileStore = inject(PosProfileStore); private readonly posInfoStore = inject(PosInfoStore); private readonly deviceInfoStore = inject(DeviceInfoStore); logo = images.logo; async ngOnInit() { const data = await this.deviceInfoStore.getData(); const profileObs = await this.posProfileStore.getData(); const infoObs = await this.posInfoStore.getData(); forkJoin([profileObs, infoObs]) .pipe( finalize(() => { this.onComplete.emit(); }), ) .subscribe(([profileResult, infoResult]) => {}); } }