Replace any with actual type in ProcessManagerService

This commit is contained in:
Kristóf Tóth 2018-03-07 17:14:30 +01:00
parent 955ddac7c6
commit e595b0ccc1

View File

@ -3,6 +3,7 @@ import { Injectable } from '@angular/core';
import { WebSocketService } from './websocket.service';
import { ProcessCommand } from './processcommand';
import { filter } from 'rxjs/operators';
import { WSMessage } from './wsmessage';
@Injectable()
@ -16,11 +17,11 @@ export class ProcessManagerService {
this.webSocketService.connect();
}
subscribeCallback(process_name: string, callback: (event: any) => void) {
subscribeCallback(process_name: string, callback: (event: WSMessage<ProcessCommand>) => void) {
this.observeProcessMessage(process_name).subscribe(callback);
}
subscribeErrorCallback(process_name: string, callback: (event: any) => void) {
subscribeErrorCallback(process_name: string, callback: (event: WSMessage<ProcessCommand>) => void) {
this.observeProcessMessage(process_name).pipe(filter(message => 'error' in message.data)).subscribe(callback);
}