Welcome to the Book of RxJS! This book is meant to serve as a textbook, reference guide, and collection of examples and musings on the art of RxJS, the JavaScript implementation of the ReactiveX library! RxJS takes many concepts you might already be familiar with, like Arrays and Promises, and combines them to make all of your async operations and data manipulations work together seamlessly, efficiently, and all with a declarative interface!
In time, this book will have explanations, diagrams, code examples, exercises, videos, and projects illuminating the use of this whole library! However, as of July 2023, this is still very much in an early stage, so you may be seeing unfinished chapters, or chapters that are merely outlines or code examples, so please bear with me through this stage. This particular format of Markdown pages in Github is also meant as an MVP, so I can get material online quickly. If you’re willing to bear with me, I hope to create the most useful resource on RxJS available!
I’m so glad you asked!
And finally, if you want to say thank you and support the ongoing elaboration of this work, you can always buy me a coffee or support this project through Github Sponsors.
This book is unusual in its… bookiness. You might be looking to understand RxJS, write RxJS code, or design applications with the patterns defined in RxJS. You might be sold on RxJS, you might be skeptical. So there are many parts designed for different people at different stages in their journey with the library.
In my experience, there are 5 stages of RxJS:
With that in mind, I recommend a bit of caution. If you’re reading something, and you realize that you haven’t understood anything for the last 2 minutes, stop. Maybe that part isn’t for you right now. Take a look at it, register “I know that you can do this particular thing with RxJS, I just don’t know how you can do this particular thing with RxJS.” And that might be the thing you need to know right now.
The thing I have found in my journey with RxJS has been a complete and total rewiring of my brain. The more I have learned to streamline my understanding so that it works in RxJS, the easier it has been to break down complex coding problems and see them for what they were. Sometimes, I’ll be working in another library, and jot down my thoughts as an Observable or set of operators, only to re-write my thoughts in the idioms of the library I was working in.
So, if you’re just starting, a Tour of the Library will be an excellent place to start. Each chapter will have explanations, code samples, and perhaps even a quiz or a tutorial attached.
After that, there are a series of articles, little essays on what I’ve learned along the way. That will also include guides for integrating RxJS with other libraries, like React.
The last section is the cookbook. I say cookbook, but this will be less like “how you should do this” and more like “how I did this”. The goal isn’t to give you step-by-step instructions. The goal is to give you insight into how to approach designing applications with RxJS.
Finally, there is an index. If all goes well, the index will be your most potent resource for RxJS. You’ll be able to look for any member of the library, and see every place it’s used throughout this book. That will give you all sorts of context as you seek to understand what a specific operator might do or mean when used in a certain way.
What is RxJS? | How much JavaScript and TypeScript do I need? |
All | Classes | Subjects | Functions | Pipeable Operators | Creation Operators | Schedulers | Consts | Types | Deprecated |