Questions tagged [rxjs6]

RxJS6 is version 6 of Reactive Extensions for JavaScript, with some added changes in websocket, testing and bug fixes.

1219 questions
9
votes
2 answers

ERROR EmptyErrorImpl {message: "no elements in sequence", name: "EmptyError"} in Angular 7

I am getting a weird error while trying to navigate to different routes from a specific component. If I navigate to different routes from other components I am not seeing this error. I am attaching the screenshot of the error I have searched for…
BKM
  • 6,949
  • 7
  • 30
  • 45
9
votes
2 answers

error TS2339: Property 'combineLatest' does not exist on type 'typeof Observable'

I have a problem when I try to start my angular 6 project. I've got this error : "TSError: ⨯ Unable to compile TypeScript: git.version.ts(34,29): error TS2339: Property 'combineLatest' does not exist on type 'typeof Observable'." It worked well…
Joe Allen
  • 1,267
  • 4
  • 24
  • 41
9
votes
1 answer

What is the correct way to use concat along with pipe in Rxjs 6?

I have a server call which may return HTTP 202. Influenced by this SO thread, I have the following: this.http.get(url) .pipe( map(response => { if (response.status === 202) { throw response; } return response; …
kmansoor
  • 4,265
  • 9
  • 52
  • 95
9
votes
6 answers

Angular 6: Property 'of' does not exist on type 'typeof Observable'

I am using Angular 6 using "rxjs": "^6.0.0", ERROR : Property 'of' does not exist on type 'typeof Observable'. import { Injectable } from '@angular/core'; import { TranslateLoader } from '@ngx-translate/core'; import { Observable, Subject, pipe, of…
HD..
  • 1,456
  • 3
  • 28
  • 48
9
votes
1 answer

How to use rxjs6 partition in typescript?

When I try to use rxjs6 partition in typescript a type missmatch error is thrown. Also the example from the official documentation throws that error. I think I have to cast something, but I don't know what. Any suggestions? import {fromEvent} from…
fastr.de
  • 1,497
  • 14
  • 23
8
votes
3 answers

RxJS combineLatest even if one of the sources is not emitting values

I need data from two sources to combine into one res: {data1: any, data2: any} object, and I need to achieve this even if one of the sources doesn't emit any values Here's the structure I expect: xxx ( source1, source2, (data1, data2) =>…
godblessstrawberry
  • 4,556
  • 2
  • 40
  • 58
8
votes
2 answers

How can I delay an observable only if it returns faster than the delay

Take for example: this.http.get('/getdata').pipe(delay(2000)) I would like this request to take a minimum of 2s to complete, but not any longer than it takes for the request to complete. In other words: if the request takes 1s to complete, I want…
parliament
  • 21,544
  • 38
  • 148
  • 238
8
votes
1 answer

RxJs: ConcatMap VS ConcatMapTo, MergeMap VS MergeMapTo

The documentation isn't helpful enough for me to understand the difference between these. It's like concatMap, but maps each value always to the same inner Observable. http://reactivex.io/rxjs/file/es6/operators/concatMapTo.js.html I tried…
squirrelsareduck
  • 874
  • 1
  • 10
  • 15
8
votes
5 answers

NGRX selector requests data before it's available in the store

When the user selects an item on the screen an action is triggered that requests data from the api and loads that data into the store for the selected item. A selector is used to grab specific pieces of that returned data to create a graph. The…
dcp3450
  • 10,959
  • 23
  • 58
  • 110
8
votes
3 answers

Type 'Observable>' is not assignable to type 'Observable<>'

I have this code snippet: SubmitTransaction(transNumber: string, transactionRequest: ITransactionRequestObj): Observable { this.body = JSON.stringify(transactionRequest); this.headers = new…
Euridice01
  • 2,510
  • 11
  • 44
  • 76
8
votes
2 answers

Property 'delay' does not exist on type 'Observable'

After upgrading to angular6 fews problem while using rxjs import { Observable, Subject, asapScheduler, pipe, of, from, interval, merge, fromEvent } from "rxjs"; import { delay } from "rxjs/operators"; let obser = from([ 1, 2, 3…
Pascal
  • 2,377
  • 3
  • 25
  • 40
8
votes
2 answers

RXJS Continue with concat subscribe after error

I have an array of observables that need to fire off sequentially. Once an error happens, I need the to catch the error, log it, and continue observing. At the moment, once an error occurs, the observer stops. It's essential that the observer…
Zander Rootman
  • 2,178
  • 2
  • 17
  • 29
8
votes
2 answers

RxJS Migration 5 to 6 - Unsubscribe with TakeUntil

What is the best way to unsubscribe in RxJS 6? My 'old' RxJS 5 code looks this export class MyComponent implements OnInit, OnDestroy { private ngUnsubscribe: Subject = new Subject(); this.myService.myEventEmitter …
Juri
  • 1,531
  • 2
  • 20
  • 43
8
votes
2 answers

RxJs 6: Get ConnectableObservable from Observable

Angular 6 requires an update to RxJs 6 and with that RxJs update the Observable.publish() function is gone. I found a publish operator in RxJs/operators but I'm having trouble figuring out how to use it. How could this RxJs 5 code be rewritten to…
Kevin Kalitowski
  • 6,829
  • 4
  • 36
  • 52
8
votes
2 answers

How to get "Observable.of([]);" to work?

What is the correct expression and import for Observable.of([]);. import { of } from 'rxjs'; does not work for me.
Rose Nettoyeur
  • 885
  • 1
  • 16
  • 29