What is Reactive Programming?

Reactive Programming means observing a piece of data and reacting to changes. 

Reactive programming is programming with asynchronous data streams.

Example data stream for a click button.

How to implement reactive programming.

Libraries exist in many programming language to enable the use of reactive programming. The most popular and well-maintained is Rx, Reactive Extensions. 

Observer Pattern

  • Rxjs and most other reactive libraries use the "Observable" design pattern
  • A "Subject", or "Observable", holds a collection of "Observers"
  • The "Subject" will notify all "Observers" when it receives a new value

The Observer pattern is like a postal service. The Post Office is the Subject and all of the mail recipients are the Observers.

You don't go need to check the post office for mail, they bring it straight to you.

RXJS (Reactive Extensions for JavaScript) extends the reactive programming paradigm with the ability to manipulate streams of data. 

Helpful Content

Rxjs

  • https://www.learnrxjs.io/
  • https://www.youtube.com/watch?v=49dMGC1hM1o
  • https://gist.github.com/staltz/868e7e9bc2a7b8c1f754
  • https://sourcemaking.com/design_patterns/observer

NGRX

  • http://www.clearlyinnovative.com/ngrx-state-management-inclusive-innovation-incubator
  • https://github.com/aaronksaunders/ionic4-ngrx-firebaseBullet Three

What is Reactive Programming?

By Michael Busby

What is Reactive Programming?

  • 1,183