What is Reactive programming and how does it relate to Angular?

Technology CommunityCategory: AngularWhat is Reactive programming and how does it relate to Angular?
VietMX Staff asked 3 years ago

Reactive programming is programming with asynchronous data streams. RxJs stands for Reactive Extensions for Javascript, and it’s an implementation of Observables for Javascript. An Observable is like a Stream (in many languages) and allows to pass zero or more events where the callback is called for each event. Angular currently uses RxJs Observables in two different ways:

  • as an internal implementation mechanism, to implement some of its core logic like EventEmitter
  • as part of its public API, namely in Forms and the HTTP module

You do not need to know Reactive Programming or RxJS in order to build even the most complex applications with Angular. It can however make some types of applications easier to architect.