The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Split an RxJS observable with window

Split an RxJS observable with window

6:58
Mapping the values of an observable to many inner observables is not the only way to create a higher order observable. RxJS also has operators that take a first order observable and return a higher order Observable. In this lesson we will learn about window, an operator to split an observable.
Watch this lesson now
Avatar
egghead.io

Mapping the values of an observable to many inner observables is not the only way to create a higher order observable. RxJS also has operators that take a first order observable and return a higher order Observable. In this lesson we will learn about window, an operator to split an observable.

Avatar
Sen

Can you please explain how this operator differs from buffer operator?

In reply to egghead.io
Avatar
Andre

Hi Sen. Check out the official docs (which I wrote): http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html#instance-method-window

[buffer] collects values from the past as an array, and emits that array only when another Observable emits.

[window] is like buffer, but emits a nested Observable instead of an array.

In reply to Sen
HEY, QUICK QUESTION!
Joel's Head
Why are we asking?