Skip to content
Advertisement

Tag: rxjs

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

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

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,

Advertisement