redoc/lib/services/app-state.service.ts

24 lines
549 B
TypeScript
Raw Normal View History

2016-10-23 20:18:42 +03:00
'use strict';
2016-12-02 12:59:29 +03:00
import { Injectable } from '@angular/core';
2016-10-23 20:18:42 +03:00
import { Subject } from 'rxjs/Subject';
import { BehaviorSubject } from 'rxjs/BehaviorSubject';
@Injectable()
export class AppStateService {
samplesLanguage = new Subject<string>();
error = new BehaviorSubject<any>(null);
2016-11-23 02:23:32 +03:00
loading = new Subject<boolean>();
2016-12-02 12:59:29 +03:00
initialized = new BehaviorSubject<any>(false);
2016-11-23 02:23:32 +03:00
2017-01-28 19:47:12 +03:00
searchContainingPointers = new BehaviorSubject<string|null[]>([]);
2016-11-23 02:23:32 +03:00
startLoading() {
this.loading.next(true);
}
stopLoading() {
this.loading.next(false);
}
2016-10-23 20:18:42 +03:00
}