mirror of https://github.com/Squidex/squidex.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
788 B
33 lines
788 B
/*
|
|
* Squidex Headless CMS
|
|
*
|
|
* @license
|
|
* Copyright (c) Sebastian Stehle. All rights reserved
|
|
*/
|
|
|
|
import { Observable } from 'rxjs';
|
|
|
|
import { AppsStoreService, NotificationService } from './../declarations-base';
|
|
|
|
import { ComponentBase } from './component-base';
|
|
|
|
export abstract class AppComponentBase extends ComponentBase {
|
|
private appName$: Observable<string>;
|
|
|
|
constructor(notifications: NotificationService,
|
|
private readonly appsStore: AppsStoreService
|
|
) {
|
|
super(notifications);
|
|
|
|
this.appName$ = this.appsStore.selectedApp.filter(a => !!a).map(a => a!.name);
|
|
}
|
|
|
|
public appName(): Observable<string> {
|
|
return this.appName$;
|
|
}
|
|
|
|
public appNameOnce(): Observable<string> {
|
|
return this.appName$.take(1);
|
|
}
|
|
}
|
|
|
|
|