funky-framadate-front/src/app/core/services/theme.service.ts

16 lines
438 B
TypeScript
Raw Normal View History

2020-04-22 12:56:18 +02:00
import { Injectable } from '@angular/core';
import { BehaviorSubject, Observable } from 'rxjs';
import { Theme } from '../enums/theme.enum';
@Injectable({
providedIn: 'root',
})
export class ThemeService {
private _theme: BehaviorSubject<Theme> = new BehaviorSubject<Theme>(Theme.LIGHT);
public readonly theme: Observable<Theme> = this._theme.asObservable();
public selectTheme(theme: Theme): void {
this._theme.next(theme);
}
}