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-19 00:48:55 +03:00
|
|
|
searchContainingPointers = new BehaviorSubject<string[]>([]);
|
|
|
|
|
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
|
|
|
}
|