如何以更惯用的rxjs方式处理这些功能

时间:2019-02-15 11:08:23

标签: rxjs

我是rxjs的新手(该项目暂时停留在rxjs 5上),我真的不需要重构这些功能,但是由于我想尽快熟悉rxjs,我怎么不使用if(date.compareTo(date1)== 0) { timer(diff); Intent intent = getIntent(); String imageURL = intent.getStringExtra("urlKey"); initViews(); displayImage(imageURL); setListeners(); } else { Toast.makeText(getApplicationContext(), "Time Expired", Toast.LENGTH_SHORT).show(); } 进行http呼叫:

toPromise

我也有这个try { const response = await this.http.post(`${TokenUrl}`, payload, options).toPromise(); } catch(err) { // whatever } 可以定期ping服务器:

setInterval

我尝试使用this.timerId = setInterval(() => { this.blobStorageService.ping(); }, 60000); ,但语法不太正确。

0 个答案:

没有答案