Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Reactive Programming in Angular with RxJs

Reactive Programming in Angular with RxJs

RxJs is Reactive Extensions For JavaScript. RxJS allows you to solve hard problems with less code, promotes maintainability, readability, flexibility. With RxJs, you can handle this in a declarative and flexible way alongside redux or you can replace Redux altogether.

Hiren Dave

July 25, 2020
Tweet

More Decks by Hiren Dave

Other Decks in Technology

Transcript

  1. Hiren Dave Tech Author, Blogger and Speaker Co-Organizer, GDG Ahmedabad

    Blog : https://hirendave.tech Twitter : @hjdave
  2. In Simple Terms, • It deals with series of events

    • Automatically detect changes and propagate it • Receive incoming changes and take necessary action on it • While taking actions, don’t know about previous state or data
  3. Asynchronous Data Stream, • It’s sequence of on-going events. •

    Anything can be in stream. For example, data collection, inputs, events etc. • It emits three possible things - Next Value - Error - Complete Signal
  4. What is RxJs, • Reactive Extensions for JavaScript • Most

    popular Library for reactive programming • Built on Observable pattern • Supports multiple libraries
  5. Observer has certain handlers const observer = { next(value) {

    console.log(value) }, error(msg) { console.log(msg) }, complete() { console.log(“done”) } }
  6. The Observable, • Push Vs. Pull • It’s Push system

    for JavaScript • It’s stream that we use to listen for changes • It produces multiple values.
  7. The Observer, • It’s a consumer of values generated by

    Observable. • It’s set of Callbacks. • Allows you to define next value and action.
  8. The Subject, • It’s a special type of Observable •

    Allows you to multicast value to various observers • Used to subscribe
  9. The Operators, • Special functions • Allows you to manipulate

    data coming from subject • There are lots of inbuilt Rx operators