RxJS stands for Reactive Extensions, which is a modular library that enables reactive programming, which itself is an asynchronous programming paradigm and allows for manipulation of data streams through transformation, filtering, and control functions. You can think of reactive programming as an evolution of event-based programming.
In Event-Driven programming, you would define an event handler and attach it to an event source. In more concrete terms, if you had a save
button, which exposes an onClick
event, you would implement a confirmSave
function, which when triggered, would show a popup to ask the user Are you sure?
. Look at the following figure for a visualization of this process.
Event-Driven Implementation
In short, you would have an event firing once per user action. If the user clicks on the save
button many times, this pattern would gladly render as many popups as there are clicks, which doesn't make much sense.
The publish...