rxjs Questions

2

I'm trying to catch http request's errors from an Angular interceptor and handle 401 as logout while retrying a 503 and 504 responses n times. This is my http interceptor: intercept(req: HttpRequ...
Centuple asked 18/4, 2019 at 15:16

2

Solved

I need a NestJS interceptor that archives requests, both in exceptional and happy-path cases. Created as follows: public intercept(context: ExecutionContext, next: CallHandler): Observable<any...
Soapberry asked 8/7, 2019 at 4:46

3

Solved

I have a requirement to pull a few resources from another domain held by my company. I want to pull secured HTML content with GET requests. When a user is signed out of the application the request...
Barfield asked 27/4, 2016 at 9:22

6

Solved

i am trying to migrate from rxjs 5 to 6 but i am having difficulties. when i try this this._connectivity.isOnline().pipe(first()).subscribe((state) => { this.syncCheck(user.uid); }); i am ge...
Sining asked 2/8, 2018 at 5:51

4

Solved

I am reading the official documentation of RxJS and then I realized they both are doing exactly the same thing. To me they both seem exactly similar. Please point out the difference between them if...
Celle asked 27/8, 2016 at 19:11

4

Solved

In RxJS, there is a switchMap function. Is there an equivalent in ReactiveX/Rx.NET? I don't see one in the transforming documentation.
Cassy asked 31/3, 2017 at 11:22

10

Solved

I'm making use of the withLatestFrom operator in RxJS in the normal way: var combined = source1.withLatestFrom(source2, source3); ...to actively collect the most recent emission from source2 and...
Vaucluse asked 23/8, 2016 at 9:43

3

Let's say I have an Angular Component which defines an Observable myObs$ as one of its properties. In one test, given certain conditions, I want to test that myObs$ does not notify. In the logic t...
Garrott asked 30/1, 2019 at 18:15

4

Solved

What is the difference between skipWhile and filter operators? const source = interval(1000); const example = source.pipe(skipWhile(val => val < 5)); const subscribe = example.subscribe(val ...
Ahab asked 22/3, 2018 at 7:59

6

Solved

I need to dispatch multiple actions after calling an API request in my effect. I'm using this code at the moment to dispatch one action after API request done: changeStatus$ = createEffect(() =&gt...
Fermium asked 8/9, 2021 at 8:39

8

Solved

I want to execute tap() only when i get the first emitted value Something like: Observable .pipe( tap(() => { /* execute only when I get the first emitted value */ }) ) .subscribe(() =>...
Cyclotron asked 8/1, 2019 at 20:27

6

Solved

private customer: Subject<Object> = new BehaviorSubject<Object>(null); setCustomer(id, accountClassCode) { this.customer.next({'id': id, 'accountClassCode': accountClassCode}); } get...
Scutate asked 22/6, 2017 at 7:54

2

Solved

I have Angular code like this which listens to changes on multiple fields and then saves the changes when any of them change. The problem is that the story is getting saved even though nothing is b...
Edmondson asked 2/5, 2024 at 12:50

10

Solved

I have set up the following routing system export const MyRoutes: Routes = [ {path: '', redirectTo: 'new', pathMatch: 'full'}, {path: ':type', component: MyComponent} ]; and have the following n...
Monterrey asked 19/11, 2016 at 23:56

6

The abstract problem Is there any way to consume the result of a mergeMap in the original order of the outer observable, while still allowing the inner observables to run in parallel? More detaile...
Fertile asked 15/7, 2019 at 19:13

9

Solved

Currently have a scenario where a method within a shared service is used by multiple components. This method makes an HTTP call to an endpoint that will always have the same response and returns an...
Gerbold asked 14/6, 2018 at 19:56

2

Solved

Seemingly out of the blue I am getting errors with RxJS. My project is Angular, Typescript and I use RxJS as part of NGRX redux. My code seemed to work absolutely fine with just this as an import...
Krypton asked 4/9, 2017 at 10:36

5

Solved

I have a signal that is bound to an input field. I'm trying to define an effect() for the searchTerm, but because it's user input, I'd like to debounce that effect (i.e. rxjs) so that the search do...
Senior asked 2/7, 2023 at 3:31

4

Solved

I have an auth guard that needs an asynchronous response true/false when the site is visited and the user is already logged in. I'm using Firebase's onAuthStateChanged (link to docs) and it uses ...
Bridwell asked 31/3, 2017 at 2:0

12

Do you need to unsubscribe from Angular 2 http calls to prevent memory leak? fetchFilm(index) { var sub = this._http.get(`http://example.com`) .map(result => result.json()) .map(json => ...
Gerlach asked 27/1, 2016 at 16:33

3

Solved

I'm trying to log the click event on a button in react: const InputBox = () => { const clicky = fromEvent( document.getElementById('clickMe'), 'click' ).subscribe(clickety => console.log...
Baeda asked 14/10, 2019 at 3:26

3

Solved

Now that all modern browser support javascript modules, I'm trying out importing code right in the browser. We can get npm modules from unpkg.com, and I've found the jspm project, which wraps npm m...
Alate asked 12/5, 2018 at 15:49

6

Solved

I know Redux is a better "implementation" of Flux, or better saying it's a redesign to simplify things (application state management). I have heard a lot about reactive programming (RxJS)...
Dom asked 28/12, 2015 at 16:44

6

Solved

example: var s1 = Observable.of([1, 2, 3]); var s2 = Observable.of([4, 5, 6]); s1.merge(s2).subscribe(val => { console.log(val); }) I want to get [1,2,3,4,5,6] instead of [1,2,3] [4,5...
Fussy asked 23/5, 2017 at 17:38

2

Solved

App.service file looks like this: import { Injectable } from '@nestjs/common'; import { HttpService } from '@nestjs/axios'; import { Observable, firstValueFrom } from 'rxjs'; // import { firstValue...
Thom asked 16/5, 2022 at 1:55

© 2022 - 2025 — McMap. All rights reserved.