💥 The RxJs shareReplay Operator - preventing duplicate HTTP requests
HTML-код
- Опубликовано: 6 июл 2018
- This video is part of the RxJs In Practice Course - angular-university.io/course/...
Check out the Angular University Ebooks:
Check out the PDF E-Books available at the Angular University -
angular-university.io/my-ebooks
For more videos tutorials on Angular, check the Angular University website - angular-university.io
Follow us:
Twitter - / angularuniv
Google+ - plus.google.com/u/1/113731658...
Facebook - / angular.university
This video is part of the RxJs In Practice Course - angular-university.io/course/rxjs-course
The video is great, explains really well what this operator can do for you... But you didn't mention its optional parameters and how you may use it: bufferSize, window and scheduler...
The best explanation ever! Thanks!
Thank you 😊
Great video Vasco, thanks!
In that case, how can we refetch HTTP request again?
excellent
If the two subscriptions where located in two different components is the result going to be same?
Why not use behaviorsubject instead ?
How is it use with NgRX Selectors? It is the same?
Actually Ngrx selectors are a whole separate thing, they are not related to this operator. I have content on that, I think here on the channel but also on my NgRx In Depth course.👍
You have a problem, Why are you calling http requests in that way?
You have to make just one http request using a Promise, and when you have this response, you only need to use Array.map and Array.filter to separate categories and that's it!
Then in your component you assign that category in a class property. Don't do crazy things.
And also these observables never going to emit any new information until reload page! So you dont need to use, at least that you were using a real time database like Firebase
Than what's is the point of using rxjs at all . In this example the author mentioned blueprint which could many complex calculation and you want to share the result in different places. I found it useful when I had to render two different charts in two different locations, in the same page and I couldn't change the backend api