I want to take 3 last elements from an observable. Let\'s say that my timeline looks like this:
--a---b-c---d---e---f-g-h-i------j->
where:
You can look at Observable#bufferCount function. One difference is that it wants at least 3 times to emit (first parameter, in this example).
const source = Rx.Observable.interval(1000); const example = source.bufferCount(3,1) const subscribe = example.subscribe(val => console.log(val));