All Questions

166
votes
18answers
47641 views

What is the correct way to share the result of an Angular Http network call in RxJs 5?

By using Http, we call a method that does a network call and returns an http observable: getCustomer() { return this.http.get('/someUrl').map(res => res.json()); } If we take this observab...
32
votes
4answers
40242 views

Angular2 http at an interval

I am quite new to angular and rxjs. I am trying to create an angular2 app that gets some data from staticly served text file(Locally on server), which I would like to retrieve and map to Datamodel us...
2
votes
1answers
585 views

Angular 2 + rxjs - how return stream of objects fetched with several subsequent http requests

I have data classes class Processor { frequency: number; error: booelan; } class Computer { name: string; processor: Processor[]; } I faetch it from backend using json: { "nam...
22
votes
1answers
14192 views

Angular 2 router resolve with Observable

After release of Angular 2 RC.5 there was introduced router resolve. Here demonstrated example with Promise, how to do the same if I make request to server with Observable? search.service.ts ... sea...
24
votes
4answers
32640 views

How to return value from function which has Observable subscription inside?

I dont know how to extract value from Observable to be returned by function in which Observable is present. I need just a value from it to be returned, nothing else. Current version which works func...
15
votes
1answers
2273 views

How to use Rx.Observable.prototype.let operator?

The example and explanation of the let operator (https://github.com/Reactive-Extensions/RxJS/blob/master/doc/api/core/operators/let.md) is not clear. Anyone has a good example/explanation how the let ...
18
votes
2answers
7363 views

How does the RxJs 5 share() operator work?

Its not 100% clear for me how the RxJs 5 share() operator works, see here the latest docs. Jsbin for the question here. If I create an observable with a series of 0 to 2, each value separated by one ...
7
votes
2answers
1773 views

SystemJS loads many files for rxjs

I have the following systemjs.config.js (based on some example I found on the internet): (function (global) { System.config({ paths: { // paths serve as alias 'js:...
7
votes
4answers
1994 views

How do I test a function that returns an observable using timed intervals in rxjs 5?

For example, I have a function like this: export function timeRange(start: number, end: number): Rx.Observable<number> { return Rx.Observable.interval(1000) .map(n => n + start) .take(...
3
votes
1answers
126 views

Rx.Subject loses events

Can anybody explain what the differents between these 3 variants? http://jsfiddle.net/8vx2g3fr/2/ First works as excpect, all events are processed. But second loses last event (3) Third loses sec...

Previous Next