I have an issue where function callWebsocket
is not getting paused for def.preProcessor
dialog box action. As a result this.ws.call
is getting evaluated. I want this.ws.call
to wait for the results of def.preProcessor
dialog box action.
export class ApiService {
VmStart:{
apiCall:{
....
},
async preProcessor(def:ApiCall, self ) {
self.dialog.confirm("OverCommit","Overcommit memory?").subscribe((res)=>{
console.log(res);
});
return def;
},
},
}
async callWebsocket(evt:CoreEvent,def){
let cloneDef = Object.assign({}, def);
if(evt.data){
cloneDef.apiCall.args = evt.data;
// PreProcessor: ApiDefinition manipulates call to be sent out.
if(def.preProcessor){
cloneDef.apiCall = await def.preProcessor(def.apiCall, this);
}
let call = cloneDef.apiCall;//this.parseEventWs(evt);
this.ws.call(call.namespace, call.args).subscribe((res) => {
});
}
}