'use strict'; import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; import { BehaviorSubject } from 'rxjs/BehaviorSubject'; @Injectable() export class AppStateService { samplesLanguage = new Subject(); error = new BehaviorSubject(null); loading = new Subject(); initialized = new BehaviorSubject(false); searchContainingPointers = new BehaviorSubject([]); startLoading() { this.loading.next(true); } stopLoading() { this.loading.next(false); } }