| /// <reference path="../../../../typings/index.d.ts"/> |
| import {Subject, Observable} from 'rxjs/Rx'; |
| import {IWSEvent, IWSEventService} from '../websocket/global'; |
| export interface IStoreService { |
| query(): Observable<any>; |
| export class SynchronizerStore { |
| static $inject = ['WebSocket']; |
| private _notifications: Subject<IWSEvent> = new Subject(); |
| private webSocket: IWSEventService |
| .filter((e: IWSEvent) => { |
| if (!e.msg || !e.msg.changed_fields) { |
| return e.msg.changed_fields.indexOf('backend_status') > -1; |
| this._notifications.next(event); |
| return this._notifications.asObservable(); |