Reactive programming using RxJS with Angular

Introduction

This article belongs to a series called “Angular meets RxJS” in which I try to explain reactive programming using RxJS in a “Angular” context the best I can.

Table of contents

  • Basic concepts
  • RxJS subjects
  • RxJS operators (Part 1)
  • RxJS operators (Part 2)
  • Higher order observables (coming soon)

In this article…

In the previous article, we focused on the basic concepts that you must know and understand to use “RxJS” in an efficient way. In this one, we’ll talk about “RxJS” subjects. A subject is a special kind of observable as they allow the same values to be sent to multiple observers.

This short explanation can be a little misleading as we saw in the previous article that all observers connected to an observable receive the values emitted by this one. That’s true, however, the observables created in the previous article were all “cold”, so it means that if you have three observers connected to the same observable, they would all receive a different set of values. However, with “RxJS”, all the observers would actually receive the same set of values.

Don’t worry, it might sounds a bit confusing but you’ll find in this article two different versions of the same code showing clearly the difference.

#angular #javascript #rxjs #web-development #programming

Angular Meets RxJS: RxJS Subjects
2.15 GEEK