Questions tagged [rxjs]

A JavaScript library that uses observables to work with reactive programming that deals with asynchronous data calls, callbacks and event-based programs.

Resources

Related tags

20563 questions
6
votes
4 answers

Should I unsubscribe from Cold Observable?

I know that it's good practice to unsubscribe from Observable to prevent memory leak. But if it's Cold Observable should I also unsubscribe from it? For example one that is returned by Http.get()
Stepan Suvorov
  • 25,118
  • 26
  • 108
  • 176
6
votes
2 answers

ReactiveX Observable from NodeJS Express 'post'

Is it possible to create an ReactiveX Observable from: app = express(); app.post('/path', function() {...}) ? I mean, there exists a way to create an observable fromEvent in which I already used for lots of events that were registered using…
user6791424
6
votes
2 answers

Skip programmatic changes in valueChanges of Angular 2 control

I'm subscribing to the valueChanges observable of an Angular 2 (2.2.1) control. It's defined in AbstractControl in @angular\forms\src\model.d.ts and it's doc string states that it will yiald changes from the UI as well as programmatic ones: /** *…
EagleBeak
  • 6,939
  • 8
  • 31
  • 47
6
votes
1 answer

What is the differnce between 'do' and 'finally' when using RxJS observables to take action after the observable returns?

I don't see very good documentation on what the difference is between do and finally in RxJS. My goal is to take action only when an Observable returns data but it looks like they will both take action on failure as well. do says "Invokes an action…
Tyler Christian
  • 520
  • 7
  • 14
6
votes
2 answers

How to easily convert or assign an Observable to a Behavior Subject, so other component can share it

I am new to Observable style programming. I have a question: I want to share user info across the app between component - and I use BehaviorSubject to share this info. This is inspired by sharing BehaviorSubject as AuthInfo. If I can share AuthInfo…
Hugh Hou
  • 2,344
  • 5
  • 31
  • 55
6
votes
2 answers

Firebase Angularfire2 - listening on queried list child added

I'm wondering if it is possible to use "child_added" event with queried lists. Like so: this.curUserPosts = this.af.database.list('/posts', { query: { orderByChild: 'user/id', equalTo: id } }).$ref.on("child_added", (child) =>…
6
votes
1 answer

Refresh/reload a Hot Observable sequence with RxJS

I am working on a Portal in Angular 2. On login I make a request to the server to fetch the logged-in user profile. The method to fetch user profile returns an observable which is subscribed at 6 different places when the application loads. If I…
Mohammad Umair Khan
  • 515
  • 2
  • 9
  • 24
6
votes
2 answers

How to use RxJS to display a "user is typing" indicator?

I know a little bit of BaconJS, but now I'm trying to learn RxJS by creating a "User is typing..." indicator. It's pretty simple, it can be explained in two simple rules: When the user is typing, the indicator should be immediately visible. When…
adrianmcli
  • 1,956
  • 3
  • 21
  • 49
6
votes
4 answers

Angular 2: populate FormBuilder with data from http

I get my data from http with rjsx in component (let name it customer). Then i'm using inner component in customer: