small medium large xlarge

Build Reactive Websites with RxJS: Master Observables and Wrangle Events


Cover image for Build Reactive Websites with RxJS

Build Reactive Websites with RxJS

Master Observables and Wrangle Events


Upgrade your skill set, succeed at work, and above all, avoid the many headaches that come with modern front-end development. Simplify your codebase with hands-on examples pulled from real-life applications. Master the mysteries of asynchronous state management, detangle puzzling race conditions, and send spaceships soaring through the cosmos. When you finish this book, you’ll be able to tame the wild codebeasts before they ever get a chance to wreck your day.

Choose Your Format(s)

  • $19.95 In Stock
    • Beta: What do I get?

  • Ebooks are DRM free.

  • Ebook delivery options.

  • The Paper Book will ship on 2018-12-10 (roughly).

About this Title

Pages: 200 (est)
Published: 2018-12-10
Release: B5.0 (2018-10-10)
ISBN: 978-1-68050-295-4

The front-end world can be fraught with complexity. The RxJS library offers a solution: Observables. Observables merge other JavaScript asynch mechanisms such as callbacks and promises into a new way of looking at data. Instead of dealing with objects and keeping track of their state, Observables view asynchronous events as a stream. RxJS provides you the tools to manage, manipulate, and process Observables to simplify and speed up your front-end applications.

Never fear, you’re in exactly the right place. Don’t worry about getting stuck in a mire of theory. Start off with the basics, building small applications that illustrate deeper points. Take those building blocks and apply them to much more complex problems like handling asynchronous state and dodging race conditions before they happen. Once you’ve got a handle on complex problems, take a leap into architecture, discovering how to structure an Observable-based application both without a framework and in the land of Angular 2. After mastering Observables, switch gears to building a canvas-based game, demonstrating your deep understanding of the flexibility of Observables.

Master the Observable with RxJS, and make your asynchronous JavaScript code that much cleaner and simpler.

What You Need

Any major browser and text editor, as well as the current versions of git, NodeJS, and npm.

Contents & Extracts

This book is currently in beta, so the contents and extracts will change as the book is developed.

  • Introduction
    • The Goal of this Book
    • How to Read This Book
    • Setting up the Environment
    • Online Resources
    • Acknowledgments
  • Creating Observables
    • Introducing Rx Concepts
    • Building a Stopwatch excerpt
    • Using a Subscription
    • Experimenting with Observables
    • What We Learned
  • Manipulating Streams
    • Translating Pig Latin with Flatten and Reduce
    • Flattening
    • Reducing
    • Debugging an Observable Stream
    • Typeahead
    • What We Learned
  • Managing Asyncronous Events
    • Making AJAX Requests
    • Handling Errors
    • Promises vs. Observables with AJAX
    • Loading with Progress Bar excerpt
    • When Good AJAX Goes Bad
    • Progressive and Ordered Loading
    • What We Learned
  • Advanced Async
    • The Spec
    • Preventing Race Conditions with switchMap
    • Debouncing Events
    • Adding Debounce to the Typeahead
    • Building a Stock Ticker
    • What We’ve Learned
  • Multiplexing Observables
    • The Problem with Cold Observables
    • Multicasting with the Subject Class
    • Building a Chat Room excerpt
    • What We Learned
  • Using Http in Angular 2
    • TypeScript
    • Importing RxJS
    • Generating a New Project
    • Displaying returned data
    • Saving New Data
    • Routing
    • Linking Between Components
    • Editing a Single Photo
    • Adding in Analytics
    • Intercepting HTTP Calls
    • Conclusion
  • Building Reactive Forms in Angular 2
    • Building a Phone Number Input
    • Creating a phone input with Angular
    • Validating an Input
    • Building A Pizzeria Registration Form
    • Advanced validation
    • Creating a pizza ordering form
    • Conclusion
    • Bonus Points
  • Advanced Angular
    • Building performant applications
    • Managing State with ngrx
    • What have we learned?
    • Bonus Points
  • Reactive Game Development
    • Using the let operator
    • Animating objects
    • Calling next with Schedulers
    • Architecting a game
    • Building in user input
    • Building your own observables
    • Creating enemies
    • Detecting collisions
    • What we learned
    • Bonus Points


Randall is a senior software engineer at Netflix, building tools that wake up other Netflixers when things break. To offset that karma, he’s adopted a cat that wakes him up whenever a new JavaScript framework is released. He doesn’t get much sleep.