ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
16 lines (12 loc) • 375 B
text/typescript
import { Injectable } from '@angular/core';
import { ReplaySubject } from 'rxjs';
export type SiteTheme = 'default' | 'dark' | 'compact';
({ providedIn: 'root' })
export class AppService {
theme: SiteTheme = 'default';
theme$ = new ReplaySubject<SiteTheme>(1);
setTheme(theme: SiteTheme): void {
this.theme = theme;
this.theme$.next(theme);
}
}