I try to forkJoin a custom Observable (rxjs 5.5.6)
import { forkJoin } from 'rxjs/observable/forkJoin';
forkJoin(
this.resources.loadRefsCatalog()
).subscribe((res) => {
// I'm never executed :(
});
and the target is
public loadRefsCatalog(): Observable<any> {
console.log(1);
return new Observable((observer) => {
console.log(2);
// doing something
});
}
I got well the 1 and 2 in console log but i never fall in the subscribe of the forkJoin.
I try some return with {unsubscribe(){}} and observer.complete() but no change. So i'm stuck without idea of why.
Thanks in advance for any ideas.
// Off course my forkJoin is for multiple queries and others are http observable and run well, but not my own observable. I tried a lot of combination.
forkJoin
to emit. And passing a single observable toforkJoin
is somewhat pointless. – cartant