Before we start to use reactive programming, we need to install the tools we will be using throughout this book.
We will be using node version 6.9.1, the most recent LTS version of nodes at the time of writing. You can find versions of it for Windows, Mac, and Linux at the following link:
https://nodejs.org/en/download/releases/.
Note
We are going to use a lot of arrow functions throughout this book, so we expect you to have familiarity with this ES6 feature. You can run the codes described here in any node version above 4.x.
In this first chapter of this book we will be using bacon.js
, which is a library for functional reactive programming in JavaScript. This library works in both server and client. We will use it to introduce you to some concepts of functional reactive programming as it is easier to get started. We will be using version 0.7.88.
To install it on your server, just run the following command inside a node project:
npm i [email protected] -save
To add it to an HTML page, just paste the following code snippet inside it:
<script src="https://cdnjs.cloudflare.com/ajax/libs/bacon.js/0.7.88/Bacon.min.js"> </script>
The last tool we need to follow in this book is RxJS; we will use this library in later chapters. This library also runs in both client and server and we will be using version 4.1.0.
To install it on your server, just run the following command inside a node project:
npm i [email protected] -save
To add it to an HTML page, just paste the following code snippet inside it:
<script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/4.1.0/rx.all.js">
</script>
Note
For those using other package managers, you can also install bacon.js
and RxJS from Bower and NuGet.