Questions tagged [rxjs-lettable-operators]

21 questions
23
votes
1 answer

How do you catch with a pipe?

How do I do the following with lettable operators and pipe? this.httpClient .get(url) .map((res: any) => { const events = res.eventList; return events.map(e => new EventLogModel(e)); }) …
Nxt3
  • 1,970
  • 4
  • 30
  • 52
9
votes
1 answer

How would I use `do` as an RxJS lettable operator?

RxJS 5.5 allows grabbing lettable operators and piping them like so: import { ajax } from 'rxjs/observable/dom/ajax' import { catchError, map, retry } from 'rxjs/operators' ajax.getJSON('https://example.com/api/test') .pipe( retry(3, 1000), …
Kevin Ghadyani
  • 6,829
  • 6
  • 44
  • 62
4
votes
1 answer

Rxjs pipe not working with angular´s Http.get()

I have an Angular 4 Component that is calling a Service to get data. Not the strangest of situations. After I retrieve the data and need to transform it and filter it. Apparently the way to do this nowadays is to use pipe. In my…
3
votes
1 answer

Import of lettable operators and observable creation methods

I'm upgrading to Angular 5 and RxJS 5.5.2 and trying to import Observable.of operator. Before lettable operators, we did it like this: import 'rxjs/add/observable/of'; // Usage Observable.of(...) But now importing from paths containing add is…
2
votes
1 answer

Handling retryWhen status code in RxJS 5.5

I have some code I'm migrating to RxJS 5.5, which already worked. public getMentor(id: number): Observable { const url = `${this.employeeUrl}/${id}/mentor`; return this.http .get(url,…
2
votes
3 answers

Having trouble calling RxJS share using the recommended operator import

I'm trying to understand the best practice for importing rxjs operators It seems like I should import share this way, but, the following doesn't work because it says share expects 0 arguments. I'm not quite sure how to call share correctly. import…
MonkeyBonkey
  • 46,433
  • 78
  • 254
  • 460
1
vote
1 answer

How to memorize previous value from stream RxJS

I have 2 observables like this: return this.loaded$.pipe( switchMap((isLoaded: boolean) => { if (!isLoaded) { return this.userId$; } }), tap((userId: string) => { …
Vladimir Djukic
  • 925
  • 2
  • 9
  • 28
1
vote
1 answer

mergeAll not working the same as a lettable operator (rxjs 5.5+)?

Before lettable operators, the code looked like this: get someData$(): Observable { return this.dataService.higherOrderDataStream .mergeAll() .map(...); } Refactoring to use pipe, I get a type error essentially saying…
vince
  • 7,808
  • 3
  • 34
  • 41
1
vote
1 answer

Angular async *ngFor not working after selection

struggling with angular and observables. I have a observable like this: private searchResults: Observable; and I fill this with calling it like: this.searchResults = this.searchTerms.pipe( map((event: any) => event.target.value), …
Valerio
  • 3,297
  • 3
  • 27
  • 44
1
vote
1 answer

creating lettable rxjs "string.split" operator

I am attempting to do some string manipulation in rjxs, and while I can accomplish it with the built in behaviors on the string class and the array class in Javascript, I'm wanting to use this as an exercise to learn even more about rxjs and…
Ciel
  • 4,290
  • 8
  • 51
  • 110
1
vote
1 answer

How to flatten or merge arrays in rxJS

I have a structure I would like to flatten into one homogeneous array. The source array looks like this: [ { "countryCode": "CA", "countryName": "Canada", "states": [ { "stateCode": "CAAB", "stateName":…
1
vote
1 answer

RxJS lettable operators for Observable.create

Is there a lettable operator for Observable.create() imported from rxjs/Observable? I already replaced the Observable.of() also imported from rxjs/Observable by the lettable operator of() imported from rxjs/observable/of. But I could not find a…
0
votes
1 answer

RxJS applying changes for elements one by one

I need help :) I tried to find the solution in other topics, but was not able to, so I am sorry beforehand if there is any. I am a newbie. So, the problem. I have a bunch of div's. I need to add "active" class for each div, then remove it in 2 sec,…
Ivan Vilch
  • 86
  • 1
  • 4
0
votes
1 answer

Convert failing Observable into a good one

I have a call to an HTTP service that return an observable (it's part of a third party library so I cannot change its inner code) and it is throwing an error on the subscribe for a use case that I would like to handle in the happy path. I have…
0
votes
1 answer

Angular v6 pipe(map()) issue

I would appreciate if someone could shed some light on this. I have been at it for days now. Here is two functions that lives in my auth service. The login function that retrieves a valid jwt and then the refresh function that fetches a refreshed…
Memphis335
  • 265
  • 1
  • 13
1
2