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

Learning about the reactive pattern for bulk operations

We have to consider as usual our tasks as streams. The task that we are going to perform is uploading the recipe image in the backend. So, let's imagine a stream called uploadRecipeImage$ that will take the file and the recipe identifier as input and perform an HTTP request. If we have N files to be uploaded, then we will create N streams.

We want to subscribe to all those streams together, but we are not interested in the values emitted from each stream through the process; we only care about the final result (the last emission), whether the file is uploaded successfully, or whether something wrong happens and the upload fails.

Is there an RxJS operator that gathers a list of Observables together to get a cumulative result? Yes, thankfully, we have forkJoin. Let's understand the role and behavior of this operator.

The forkJoin operator

The forkJoin operator falls under the category of combination operators...

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 $19.99/month. Cancel anytime