0
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));
}

在代码中:this.xmlRequests 包含一个返回 xml 请求内容的函数数组。我正在尝试使用 rxjs post 方法将三个不同的 xml 请求发送到计数,并且我想根据 xml 请求跟踪来自计数的响应,因为我需要对每个响应执行三个不同的 graphql 突变。

4

0 回答 0