Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Reactive Patterns with RxJS for Angular
  • Toc
  • feedback
Reactive Patterns with RxJS for Angular

Reactive Patterns with RxJS for Angular

By : Lamis Chebbi
4.1 (16)
close
Reactive Patterns with RxJS for Angular

Reactive Patterns with RxJS for Angular

4.1 (16)
By: Lamis Chebbi

Overview of this book

RxJS is a fast, reliable, and compact library for handling asynchronous and event-based programs. It is a first-class citizen in Angular and enables web developers to enhance application performance, code quality, and user experience, so using reactive patterns in your Angular web development projects can improve user interaction on your apps, which will significantly improve the ROI of your applications. This book is a step-by-step guide to learning everything about RxJS and reactivity. You'll begin by understanding the importance of the reactive paradigm and the new features of RxJS 7. Next, you'll discover various reactive patterns, based on real-world use cases, for managing your application’s data efficiently and implementing common features using the fewest lines of code. As you build a complete application progressively throughout the book, you'll learn how to handle your app data reactively and explore different patterns that enhance the user experience and code quality, while also improving the maintainability of Angular apps and the developer's productivity. Finally, you'll test your asynchronous streams and enhance the performance and quality of your applications by following best practices. By the end of this RxJS Angular book, you'll be able to develop Angular applications by implementing reactive patterns.
Table of Contents (19 chapters)
close
1
Part 1 – Introduction
5
Part 2 – A Trip into Reactive Patterns
10
Part 3 – Multicasting Takes You to New Places
16
Part 4 – Final Touch

Reviewing the TypeScript typing improvements

RxJS 7 requires TypeScript 4.2 and takes advantage of its latest features. This helped the RxJS core team to improve the package types while making them stricter, more accurate, and more flexible. Providing better types can prevent runtime problems and any mismatched type confusion ahead of time.

For example, in RxJS 6, you can create a subject of a specific type and call next() without passing arguments; while, in RxJS 7, the same instruction will cause a compilation error because the subject's specified type has not been respected.

So, if you want to call next() without passing something to it, you need to make sure that your subject accepts void as a type:

//RxJs 6 example
const subject = new Subject<number>(); 
subject.next(); //compiles fine
//RxJS 7 example
const subject = new Subject<number>(); 
subject.next(); //compilation error
//RxJS 7 example
const subject = new Subject<void>(); 
subject.next...
bookmark search playlist download font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete