mirror of
https://github.com/avatao-content/frontend-tutorial-framework
synced 2025-01-16 05:41:56 +00:00
Fix anchor->key refactor conflicts after rebase
This commit is contained in:
parent
848c7ce71b
commit
21043ee74e
@ -6,7 +6,7 @@ import { ProcessCommand } from './processcommand';
|
|||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ProcessManagerService {
|
export class ProcessManagerService {
|
||||||
anchor = 'anchor_processmanager';
|
key = 'processmanager';
|
||||||
process_name: string;
|
process_name: string;
|
||||||
|
|
||||||
constructor(private webSocketService: WebSocketService) {}
|
constructor(private webSocketService: WebSocketService) {}
|
||||||
@ -17,14 +17,14 @@ export class ProcessManagerService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
subscribeCallback(callback: (event: any) => void) {
|
subscribeCallback(callback: (event: any) => void) {
|
||||||
this.webSocketService.observeAnchor<ProcessCommand>(this.anchor).subscribe(callback);
|
this.webSocketService.observeKey<ProcessCommand>(this.key).subscribe(callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
sendCommand(command: string, callback?: (event: any) => void) {
|
sendCommand(command: string, callback?: (event: any) => void) {
|
||||||
if (callback) {
|
if (callback) {
|
||||||
this.subscribeCallback(callback);
|
this.subscribeCallback(callback);
|
||||||
}
|
}
|
||||||
this.webSocketService.send(this.anchor, {'command': command});
|
this.webSocketService.send(this.key, {'command': command});
|
||||||
}
|
}
|
||||||
|
|
||||||
startProcess(callback?: (event: any) => void) {
|
startProcess(callback?: (event: any) => void) {
|
||||||
|
Loading…
Reference in New Issue
Block a user