Introduction to reactive programming
Before we get into FRP, we need to understand what it is. I will be explaining reactive programming with respect to JavaScript. The concept of reactive programming is the same in every programming language.
Reactive programming is writing code to look for asynchronous data updates, user activities, and system activities and propagate changes onto the dependent parts of the application. Reactive programming is not something new; believe it or not, you have already been doing reactive programming without realizing it. For example, the code you write to handle a button's click event is reactive code. There are various approaches to reactive programming, such as event-driven, callback, promise patterns and FRP.
Not every snippet of asynchronous code we write is reactive code. For example, uploading analytics data to a server asynchronously after a page load is not reactive code. But uploading a file to a server asynchronously and displaying a message to the...