I have a list of users (at the moment about 450) which I filter using a onValueChanges subscription and javascript filter method. It seems pretty slow. I believe it should be quicker but am unsure if it is the actual filtering of the object or the rerendering the html that is slow. When I recreated it in stackBlitz it is
Tag: rxjs
Is it better to subscribe inside a subscription or use rxjs concat with tap
I reserve data in the backend, then I get all reserved data for that item. Getting the data must only occur after the reservation so that it will be included. I have two solutions, but wonder which is the best one and if there is any advantage of using concat with tap in this example: subscription inside subscription: concat with
Implement for-await-of statement in RxJS
I have the following statement: client.list() returns an async iterable iterator, and expects the use of for await…of to resolve the promises. I would like to incorporate the code into an existing rxjs pipe that instantiates the client. I looked everywhere and I couldn’t figure out how to do so without resolving the promise inside the pipe rather than converting
Rxjs nested subscribe with multiple inner subscriptions
Original promise based code I’m trying to rewrite: I’m trying to figure a way how to avoid the nested subscriptions anti-pattern in the following scenario: What would be the correct ‘RxJS way’ to do this? Answer That seems pretty strange to me. You’re creating new subscription for each child every time parentResult arrives. Even though those eventually indeed will be
NullInjectorError: StaticInjectorError(AppModule)[NGXLoggerHttpService -> HttpBackend]:
I keep getting the following error after upgrading my NgxLogger module: main.ts core.module.ts app.module.ts Answer You have that error because your NGXLoggerHttpService is depend on HttpBackend class but HttpBackend class did not import to your providers section in your module.ts. Try to import HttpBackend to your provider.
rxjs observable.pipe(take(1)) vs toPromise
Recently I’ve been moved to a new project which uses angular 6 as frontend framework and spring for REST services. The project is in development for 2 years now and what I’ve observed was that almost all HTTP request made with angular HttpClient is then piped to take filter from rxjs. All REST APIs emit only one value. There’s no
How to handle for promise inside a piped map
I am definitely sure I am confused here so please any help is appreciated. Here is my scenario: I pull from Firestore a document: All is fine up to here. But inside the map I need a promise to resolve (or not) For example: I understand that the await cannot happen there. I am very confused how to solve this,
Rxjs One Observable Feeding into Another
I have a rather clunky looking set of code where the data from one observable is feed into another, like such: I know that there are ways to combine and chain but I need data from source to be feed into source2. The nesting of subscribes looks terrible and I’m pretty certain there is a better way to do this.
How to ‘wait’ for two observables in RxJS
In my app i have something like: Then i get two separated results, first of the _personService and then the _documentService. How can I wait for both results before call this.showForm() to finish an then manipulate the results of each one. Answer Last Update: Mar, 2022. RxJS v7: combineLatestWith From reactiveX documentation: Whenever any input Observable emits a value, it
How to convert node readable stream to RX observable
If I have a Node js stream, say for example from something like process.stdin or from fs.createReadStream, how can I convert this to be an RxJs Observable stream using RxJs5? I see that RxJs-Node has a fromReadableStream method, but that looks like it hasn’t been updated in close to a year. Answer For anyone looking for this, following Mark’s recommendation,