mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-04-01 21:13:09 +00:00
refactor(patch-db): use PatchDB class declaratively (#1562)
* refactor(patch-db): use PatchDB class declaratively * chore: remove initial source before init * chore: show spinner * fix: show Connecting to Embassy spinner until first connection * fix: switching marketplaces * allow for subscription to end with take when installing a package * update patchdb Co-authored-by: Lucy Cifferello <12953208+elvece@users.noreply.github.com>
This commit is contained in:
@@ -1,14 +1,20 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { Component, Inject, OnDestroy } from '@angular/core'
|
||||
import { AuthService } from './services/auth.service'
|
||||
import { SplitPaneTracker } from './services/split-pane.service'
|
||||
import { merge, Observable } from 'rxjs'
|
||||
import { GLOBAL_SERVICE } from './app/global/global.module'
|
||||
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
templateUrl: 'app.component.html',
|
||||
styleUrls: ['app.component.scss'],
|
||||
})
|
||||
export class AppComponent {
|
||||
export class AppComponent implements OnDestroy {
|
||||
readonly subscription = merge(...this.services).subscribe()
|
||||
|
||||
constructor(
|
||||
@Inject(GLOBAL_SERVICE)
|
||||
private readonly services: readonly Observable<unknown>[],
|
||||
readonly authService: AuthService,
|
||||
private readonly splitPane: SplitPaneTracker,
|
||||
) {}
|
||||
@@ -16,4 +22,8 @@ export class AppComponent {
|
||||
splitPaneVisible({ detail }: any) {
|
||||
this.splitPane.sidebarOpen$.next(detail.visible)
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscription.unsubscribe()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user