How I Learned Reactive Programming by Re-Building RxJs from Scratch

Shadid Haque
Bits and Pieces
Published in
6 min readNov 10, 2020

--

photo cred to Matt Hardy

Yes, the title is not a typo. We are actually going to reverse engineer RxJs library (stay tuned, tons of code to come 😀). But before we proceed let me tell you why I embarked on this crazy endeavour.

In my day job I work with libraries such as React and RxJs religiously. Needless to say my job involves a lot of google searching 😅. While surfing the internet for dev articles and going through stack overflow threads I often noticed senior devs, JavaScript gurus and functional programming aficionados like to talk about this concept call “reactive programming”. A lot of the time people like to emphasize the fact that libraries such as Rxjs and React.js are built based on the reactive programming paradigm.

So what is Reactive Programming ?

Reactive Programming is a paradigm where application depends on data streams. The application state changes based on data flow in your application. Think of a React application (i.e. Facebook) for instance. Let’s say you are on facebook and you are chatting with your friend Emily when your other friend Julia likes the cat video you shared. You will get a notification right away. Your application is reacting to the incoming data streams. Now when you share the same cat video with Emily she sees it in her chat and also can view who liked it from…

--

--

Software Craftsman | Entrepreneur | Freelancer. Always on the look for opportunities to make the world a little bit better with technology.