Mastering Reactive JavaScript

Expand your boundaries by creating applications empowered with real-time data using RxJs without compromising performance

Mastering Reactive JavaScript

This ebook is included in a Mapt subscription
Erich de Souza Oliveira

Expand your boundaries by creating applications empowered with real-time data using RxJs without compromising performance
$10.00
$39.99
RRP $31.99
RRP $39.99
eBook
Print + eBook
Access every Packt eBook & Video for just $100
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Find Out More
 
Preview in Mapt

Book Details

ISBN 139781786463388
Paperback310 pages

Book Description

If you’re struggling to handle a large amount of data and don’t know how to improve your code readability, then reactive programming is the right solution for you. It lets you describe how your code behaves when changes happen and makes it easier to deal with real-time data. This book will teach you what reactive programming is, and how you can use it to write better applications.

The book starts with the basics of reactive programming, what Reactive Extensions is, and how can you use it in JavaScript along with some reactive code using Bacon. Next, you’ll discover what an Observable and an Observer are and when to use them.You'll also find out how you can query data through operators, and how to use schedulers to react to changes.

Moving on, you’ll explore the RxJs API, be introduced to the problem of data traffic (backpressure), and see how you can mitigate it. You’ll also learn about other important operators that can help improve your code readability, and you’ll see how to use transducers to compose operators.

At the end of the book, you’ll get hands-on experience of using RxJs, and will create a real-time web chat using RxJs on the client and server, providing you with the complete package to master RxJs.

Table of Contents

Chapter 1: What Does Being Reactive Mean?
The reactive paradigm
Why do I need it?
Installation of tools
Your first code using reactive programming
Summary
Chapter 2: Reacting for the First Time
The bacon.js observables
Reacting to changes
Reading how an operator works
Transforming events using bacon.js
Summary
Chapter 3: A World Full of Changes - Reactive Extensions to the Rescue
RxJS observables
Subscribing to changes (Observer)
RxJS Subjects
RxJS Disposable
RxJS Schedulers
Summary
Chapter 4: Transforming Data - Map, Filter, and Reduce
Adding operators to observables
The map() operator
The flatMap() operator
The filter() operator
The reduce() operator
Summary
Chapter 5: The World Changes Too Fast - Operators to Deal with Backpressure
What is backpressure?
Common strategies to deal with backpressure
More ways to filter data
Summary
Chapter 6: Too Many Sources - Combining Observables
When do I need to combine observables?
Running observables
Concatenating observables
Combining observables
Summary
Chapter 7: Something is Wrong - Testing and Dealing with Errors
Dealing with errors
Acting when an error occurs
Summary
Chapter 8: More about Operators
The road so far
The fundamentals of RxJS
Going beyond the basics
Other important operators
Summary
Chapter 9: Composition
What is a transducer?
Available transducer implementations for JavaScript
The transducers-js API
Using transducers
Using transducers with RxJS
Testing transducers
A performance comparison for JavaScript code using transducers
Summary
Chapter 10: A Real-Time Server
The web chat server
Creating the project
The architecture of the server
Implementing the server
Scaling the server
Summary
Chapter 11: A Real-Time Client
Installing dependencies
The structure of our client
Building the application for the first time
Connecting to the server application
Using RxJS to manage user input
Connecting user interactions and server communication
Improving interaction with RxJS
Batching changes to the DOM
Testing the application
Summary

What You Will Learn

  • Get to know the basics of functional reactive programming using RxJs
  • Process a continuous flow of data with linear memory consumption
  • Filter, group, and react to changes in your system
  • Discover how to deal with data traffic
  • Compose operators to create new operators and use them in multiple observables to avoid code repetition
  • Explore transducers and see how they can improve your code readability
  • Detect and recover from errors in observables using Retry and Catch operators
  • Create your own reactive application: a real-time webchat

Authors

Table of Contents

Chapter 1: What Does Being Reactive Mean?
The reactive paradigm
Why do I need it?
Installation of tools
Your first code using reactive programming
Summary
Chapter 2: Reacting for the First Time
The bacon.js observables
Reacting to changes
Reading how an operator works
Transforming events using bacon.js
Summary
Chapter 3: A World Full of Changes - Reactive Extensions to the Rescue
RxJS observables
Subscribing to changes (Observer)
RxJS Subjects
RxJS Disposable
RxJS Schedulers
Summary
Chapter 4: Transforming Data - Map, Filter, and Reduce
Adding operators to observables
The map() operator
The flatMap() operator
The filter() operator
The reduce() operator
Summary
Chapter 5: The World Changes Too Fast - Operators to Deal with Backpressure
What is backpressure?
Common strategies to deal with backpressure
More ways to filter data
Summary
Chapter 6: Too Many Sources - Combining Observables
When do I need to combine observables?
Running observables
Concatenating observables
Combining observables
Summary
Chapter 7: Something is Wrong - Testing and Dealing with Errors
Dealing with errors
Acting when an error occurs
Summary
Chapter 8: More about Operators
The road so far
The fundamentals of RxJS
Going beyond the basics
Other important operators
Summary
Chapter 9: Composition
What is a transducer?
Available transducer implementations for JavaScript
The transducers-js API
Using transducers
Using transducers with RxJS
Testing transducers
A performance comparison for JavaScript code using transducers
Summary
Chapter 10: A Real-Time Server
The web chat server
Creating the project
The architecture of the server
Implementing the server
Scaling the server
Summary
Chapter 11: A Real-Time Client
Installing dependencies
The structure of our client
Building the application for the first time
Connecting to the server application
Using RxJS to manage user input
Connecting user interactions and server communication
Improving interaction with RxJS
Batching changes to the DOM
Testing the application
Summary

Book Details

ISBN 139781786463388
Paperback310 pages
Read More

Read More Reviews