Frontend JavaScript

RxJS in JavaScript - The Complete Guide to Reactive Programming

RxJS in JavaScript: complete guide to reactive programming. Observables, operators, Subject, error handling and integration with REST APIs and Angular.

Course description

RxJS in JavaScript: Master Reactive Programming from Scratch

RxJS is the library that changes the way you think about handling asynchronous data in JavaScript. Instead of nested callbacks and Promise chains, you work with streams of events that you can filter, transform, combine and control with declarative operators. In this course we build mastery of RxJS step by step — from the basic Observable all the way to REST API calls, error handling and Subjects for manual stream control.

What You'll Learn

  • What reactive programming is and why RxJS solves async problems in JavaScript
  • Creating and subscribing to Observables with subscribe(), next(), error() and complete()
  • Converting DOM events into Observables with fromEvent()
  • Transforming streams with pipe(), map(), filter() and take()
  • Handling errors in streams with catchError()
  • Creating time-based streams with interval() and timer()
  • Managing parallel streams with switchMap() — cancels the previous, keeps only the latest
  • Avoiding memory leaks with unsubscribe()
  • Manually controlling streams with Subject
  • Creating Observables with of(), from() and defer()
  • Integrating Promises and the fetch API into RxJS streams
  • Calling REST APIs on user events with defer, from, switchMap and catchError
  • Normalizing JSON responses with three different strategies

The Library Behind Angular and Much More

RxJS is the heart of Angular's async system — understanding it well means truly understanding how the framework works, not just how to use it. But RxJS is also useful in plain JavaScript: wherever there are events, HTTP, WebSocket or complex state management, RxJS gives you powerful and readable tools. This course takes you from your first Observable to complete HTTP streams with error handling.

Who This Course Is For

Ideal for JavaScript and Angular developers who want to master reactive programming. Good knowledge of modern JavaScript (ES6+), async/await and Promises is required. No prior RxJS experience is needed.

Lessons list

Let's discover together what RxJS is and why reactive programming fundamentally changes the way you handle async in JavaScript, going beyond the limitations of callbacks and Promises with Observable streams.

Guarda lezione

Let's explore the heart of RxJS: Observables. I'll show you how to create them from scratch and how to use subscribe() to receive emitted values, catch errors, and react to stream completion.

Guarda lezione

We'll go deeper into the RxJS Observable lifecycle. I'll show you how next() emits values, error() signals problems, and complete() closes the stream, all with clear practical examples in JavaScript.

Guarda lezione

I'll show you how to convert any DOM event into an RxJS Observable using fromEvent(), turning clicks, inputs, and other UI events into reactive streams you can filter and transform with operators.

Guarda lezione

In this lesson we apply fromEvent() to a text input field, creating an Observable that emits values in real time as the user types — the foundation for live search and autocomplete features.

Guarda lezione

I'll introduce pipe() and the map() operator in RxJS, showing you how to transform values inside an Observable stream and how to chain multiple operators into a readable, composable reactive pipeline.

Guarda lezione

I'll explain filter() and take() in RxJS: how to filter emitted values from an Observable based on a condition, and how to limit the number of emissions before the stream auto-completes.

Guarda lezione

Let's work through practical exercises on map(), filter(), and take() in RxJS to solidify your understanding of these core reactive programming operators in JavaScript.

Guarda lezione

I'll walk you through advanced lifecycle management in RxJS: using next() and complete() correctly inside a custom Observable, and intercepting and handling errors with catchError().

Guarda lezione

Let's explore RxJS interval() and timer(): I'll show you how to create time-driven event streams useful for periodic updates, countdowns, and any time-based logic in JavaScript.

Guarda lezione

Practical exercise with timer() and take() in RxJS: we'll build a time-based stream that emits a fixed number of values before completing, with concrete examples applied in JavaScript.

Guarda lezione

Let's dive deeper into switchMap() in RxJS. I'll show you how to manage parallel streams by automatically cancelling the previous Observable and keeping only the latest active, preventing race conditions.

Guarda lezione

I'll explain why it's essential to call unsubscribe() when working with time-based Observables like interval() in RxJS, and how to handle it correctly to prevent memory leaks in JavaScript applications.

Guarda lezione

Let's explore RxJS Subject: how it acts simultaneously as an Observable and an Observer, and how to use it to emit values manually and share a stream among multiple subscribers.

Guarda lezione

In this lesson I'll use RxJS's of() creation operator to create Observables in a simple, declarative way, emitting a sequence of static values as a reactive stream in JavaScript.

Guarda lezione

Let's see how to combine defer() and of() in RxJS to create lazy Observables: values are computed and generated only at subscribe() time, making each subscription fully independent.

Guarda lezione

I'll show you how to use RxJS from() to transform a Promise into an Observable, integrating fetch API and any Promise-based code into your reactive programming pipeline.

Guarda lezione

Let's see how to make a REST GET call with fetch() inside an RxJS stream and decode the JSON body reactively using switchMap() to chain the two async operations cleanly.

Guarda lezione

I'll build a complete pipeline to call a REST API on button click, combining defer(), from(), switchMap(), and catchError() into a clear, reliable reactive chain in JavaScript.

Guarda lezione

I'll show you how to add robust error handling to REST API calls inside RxJS streams using catchError(): how to intercept HTTP failures, recover from errors, and keep the stream alive.

Guarda lezione

We'll close the course with three different strategies to normalize and standardize REST API JSON responses inside an RxJS stream, ensuring a consistent and predictable structure throughout your reactive pipeline.

Guarda lezione
Giovanni Pace

Giovanni Pace

Ingegnere Informatico · Pratola Peligna

  • 107 Courses
About the teacher

Sono un ingegnere informatico con oltre 15 anni di esperienza nel settore ICT. Mi occupo di sviluppo software, cybersecurity, data science e intelligenza artificiale, con particolare attenzione all’innovazione e all’automazione dei processi aziendali. Da anni svolgo anche attività di docenza e formazione, creando percorsi pratici e coinvolgenti su programmazione, DevOps, AI e sicurezza informatica.

This course includes

  • Lessons 21
  • Duration 3h 38m
  • Difficulty intermedio
  • Language it
  • Certificate No

Recently viewed