mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-15 23:41:55 +00:00
Replace any with actual type in ProcessManagerService
This commit is contained in:
parent
955ddac7c6
commit
e595b0ccc1
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user