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
Reactive Patterns with RxJS for Angular

You're reading from   Reactive Patterns with RxJS for Angular A practical guide to managing your Angular application's data reactively and efficiently using RxJS 7

Arrow left icon
Product type Paperback
Published in Apr 2022
Publisher Packt
ISBN-13 9781801811514
Length 224 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Lamis Chebbi Lamis Chebbi
Author Profile Icon Lamis Chebbi
Lamis Chebbi
Arrow right icon
View More author details
Toc

Table of Contents (19) Chapters Close

Preface 1. Part 1 – Introduction
2. Chapter 1: The Power of the Reactive Paradigm FREE CHAPTER 3. Chapter 2: RxJS 7 – The Major Features 4. Chapter 3: A Walkthrough of the Application 5. Part 2 – A Trip into Reactive Patterns
6. Chapter 4: Fetching Data as Streams 7. Chapter 5: Error Handling 8. Chapter 6: Combining Streams 9. Chapter 7: Transforming Streams 10. Part 3 – Multicasting Takes You to New Places
11. Chapter 8: Multicasting Essentials 12. Chapter 9: Caching Streams 13. Chapter 10: Sharing Data between Components 14. Chapter 11: Bulk Operations 15. Chapter 12: Processing Real-Time Updates 16. Part 4 – Final Touch
17. Chapter 13: Testing RxJS Observables 18. Other Books You May Enjoy

Exploring the imperative pattern for autosave

We used Angular Reactive forms to build the New Recipe creation form. As described in the Using RxJS in Angular and its advantages section of Chapter 1, The Power of the Reactive Paradigm, Reactive forms leverage RxJS by using the valueChanges observable to track the FormControl changes. This makes our jobs easier since we want to listen to the form's value changes in order to perform a save on every change. You can find the HTML code of the New recipe creation form in the file recipe-creation.component.html template.

In recipe-creation.component.ts, we only define the form as follows:

 export class RecipeCreationComponent implements OnInit {
  constructor(private formBuilder: FormBuilder) { }
  recipeForm = this.formBuilder.group({
    id: Math.floor(1000 + Math.random() * 9000),
    title: [''],
    ingredients: [''],
 ...
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