RxJS – Subjects

Introduction

In previous posts we’ve discussed RxJS and saw few examples to understand how to use those in our angular applications

You can check the earlier posts in following links

Today, we’ll discuss Subject which is very useful and powerful feature of RxJS.

We’ll start simple with few examples mostly around the subject theory and then later we’ll put subject to good use by creating an EventBus and an Observable Service which will allow us to send data and notifications b/w components.

Let’s start with the basics first.

A key purpose of subject is to send out notifications.

A subject is a special type of observable that can multicast a value or event to multiple subscriber, meaning it provides a way to send one or more data values to listeners. Any component or service that subscribes to the subject’s observable will receive notification.

Subscribe to continue reading

Subscribe to get access to the rest of this post and other subscriber-only content.

Comments are closed.