Reactive programming

A declarative programming paradigm that operates on data streams and events.


Example

RxJS is a popular JavaScript library that uses reactive programming.

import { fromEvent, scan } from 'rxjs';

fromEvent(document, 'click')
  .pipe(scan(count => count + 1, 0))
  .subscribe(count => {
    console.log(`${count} clicks`);
  });

External Resources