constructor() {
super();
this.xmlRequests = [getRequestForLedgers, getRequestForStockItems,
getRequestForOutstanding];
}
componentDidMount() {
const url = 'http://localhost:9000/';
let count = 0;
Observable.interval(50000).mergeMap(() =>
Observable.from(this.xmlRequests))
.mergeMap(getRequest =>
Observable.fromPromise(axios.post(url, getRequest())))
.map(response => {
//console.log(response);
toJson(response.data, (err, result) => {
console.log(result):
}
.subscribe(a => console.log(a));
}
In code: this.xmlRequests contains a array of functions which returns a content of xml request. I am trying to send three different xml request to tally using rxjs post method, and i want to track which response is coming from tally as per xml request because i need to execute three different graphql mutation on each response.