你如何回报新观测(函数(观察员){...与RxJS V5? [英] How do you return new Observable(function(observer) { ... with RxJS v5?

查看:162
本文介绍了你如何回报新观测(函数(观察员){...与RxJS V5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想全部更换,我的职能,观测量返回的承诺。从这篇文章中,我才知道,我应该不再使用新的可观察到的<一个href=\"http://stackoverflow.com/questions/35676451/observable-forkjoin-and-array-argument\">Observable.forkJoin和数组参数

I am trying to replace all the promises that my functions return with Observables. From this post, I learned that I should no longer use "new Observable" Observable.forkJoin and array argument

什么是RxJS V5语法来实现这一目标本身来实现异步等待?

What is the RxJS v5 syntax to achieve this as such to achieve asynchronous waiting?

thirdFunction() {

    let _self = this;

    return new Observable(function(observer) {

        ...

        observer.next( responseargs );
        observer.complete();
    });
}

感谢您大为帮助,您可以提供的。

Thank you greatly for help you can offer.

推荐答案

有一组方法来创建不同的使用情况下可观察:

There are a set of methods to create observables for different use cases:


  • - 创建一个可观察的,并直接引发与提供的值的事件

  • 超时 - 创建一个可观察的时间的金额
  • 后触发事件
  • 间隔 - 创建一个可观察的时间的金额
  • 后反复触发
  • of - create an observable and directly trigger an event with the provided value
  • timeout - create an observable that triggers an event after an amount of time
  • interval - create an observable that triggers repeatly after an amount of time

此链接按类别为他们提供的列表:

This link provides a list of them by category:

这篇关于你如何回报新观测(函数(观察员){...与RxJS V5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆