Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Typescript 平行观察_Typescript_Ionic Framework_Reactivex - Fatal编程技术网

Typescript 平行观察

Typescript 平行观察,typescript,ionic-framework,reactivex,Typescript,Ionic Framework,Reactivex,我正在研究离子3和反应X可观测物体。我通过AngularFireDatabase方法valueChanges()得到了一个可观察的结果。我想以某种方式对其进行过滤,比如在另一个可观察对象中有一些具有特定属性的对象,并对其进行排序。我使用了Observable.forkJoin(),但它不起作用,因为我的splashscreen没有隐藏。如果你需要,我可以给你附上一些代码。或者你可以帮我举个例子。谢谢 这是我的密码 Observable.forkJoin([ this.allParticipa

我正在研究离子3和反应X可观测物体。我通过
AngularFireDatabase
方法
valueChanges()
得到了一个可观察的结果。我想以某种方式对其进行过滤,比如在另一个可观察对象中有一些具有特定属性的对象,并对其进行排序。我使用了
Observable.forkJoin()
,但它不起作用,因为我的splashscreen没有隐藏。如果你需要,我可以给你附上一些代码。或者你可以帮我举个例子。谢谢

这是我的密码

Observable.forkJoin([
  this.allParticipants = this.participantsList.valueChanges().map(res => res.sort((a, b) => a.name < b.name ? -1 : 1)),
  this.paidParticipants = this.allParticipants.map(res => res.filter(guest => guest.paid)),
]).subscribe(() => this.splashScreen.hide(), () => this.splashScreen.hide(), () => this.splashScreen.hide());
Observable.forkJoin([
this.allParticipants=this.participantsList.valueChanges().map(res=>res.sort((a,b)=>a.nameres.filter(guest=>guest.paid)),
]).subscribe(()=>this.splashScreen.hide(),()=>this.splashScreen.hide(),()=>this.splashScreen.hide());

我将隐藏方法放在所有参数中,以确定它是否在某些方面隐藏了,但它没有隐藏。

我认为
forkJoin
在这里不起作用,因为它只在所有观测值完成时发出<代码>值更改()未完成。使用
CombineTest
switchMap

请添加一些代码以便我们帮助您。我需要执行这些操作来存储有关参与者的一些信息,有没有办法并行或串行调用它们,以及如何等待所有订阅完成的方法?您是否研究过使用
forkJoin
操作符?我来看看。ThanksIt不起作用,我不知道为什么,我现在就编辑这个问题。