Reactive programming is a declarative programming paradigm that focuses on *streams of data* and the *propagation of change*. Instead of directly controlling the flow of data, you define how to respond to changes in data streams.
// Assuming you have an Observable library like RxJS
const observable = Rx.Observable.interval(1000); // Emits a number every 1 second
observable.map(x => x * 2).subscribe(
value => console.log(value),
error => console.error(error),
() => console.log('Completed')
);