Demystifying RxJs for Angular 2

Christian Nwamba

JavaScript Engineer

Technical Writer

@chrizt_n

What am up to

  • Tech Writer/Engineer @ deepstream.io
  • Tech Writer/Engineer @ scotch.io
  • Consultant @ cloudinary
  • Adonis Contributor
  • Community Building
  • OSS

Angular 2 Scary Parts

  • TypeScript
  • Decorators
  • Inline HTML & CSS
  • RxJs Observables

Observables are "like" Promises

Know the Basics!

Creating Obs vs Creating Promises

VS

Emitting Vs Resolving

VS

Throwing vs Rejecting

VS

VS

Subscribe vs Then

VS

VS

So Why is it "Hard"?

Operators! Operators!! Operators!!!

Operators receive value/observable and return value/observable which will be passed down to the stream/pipe

Categories of Operators

  • Creation
  • Transformation
  • Filter
  • Combination
  • Error Handling

Creation

Case: fromArray

Transformation

Case: map

Filter

Case: filter

Combination

Case: merge

Error Handling

Case: throw...catch

Observables + Angular

Case: HTTP

Case: HTTP (Nested)

Case: Route Params

So What is Wrong with Promises

Thank you

Demystifying RxJs for Angular 2

By Christian Nwamba

Demystifying RxJs for Angular 2

  • 625