Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Architecting Angular Applications with Redux, RxJS, and NgRx

You're reading from   Architecting Angular Applications with Redux, RxJS, and NgRx Learn to build Redux style high-performing applications with Angular 6

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781787122406
Length 364 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Christoffer Noring Christoffer Noring
Author Profile Icon Christoffer Noring
Christoffer Noring
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface Quick Look Back at Data Services for Simple Apps 1.21 Gigawatt – Flux Pattern Explained FREE CHAPTER Asynchronous Programming Functional Reactive Programming RxJS Basics Manipulating Streams and Their Values RxJS Advanced Redux NgRx – Reduxing that Angular App NgRx – In Depth Other Books You May Enjoy

Cleanup

We have now covered core concepts such as Observable, Observer, Producer, and operators. We have also looked into how we can manually create an Observable, but realized that there are different creation operators that will help you create Observables from other constructs, and sometimes the Angular framework itself will create the Observable for you. We have failed to mention one important thing though, cleanup. There will be situations where an Observable will allocate resources or simply go on forever, as with the interval() operator. There is one clear remedy to that—define and run a cleanup function when we are done with the Observable. Defining such a function forces us to return to the create operator and amend some code in its behavior function, like so:

let stream$ = Rx.Observable.create(observer => {
let counter = 0;
let id = setInterval(() => observer...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime