Answer the question
In order to leave comments, you need to log in
Why does take from RxJS skip all data further without clipping?
From the method I return a chain, at the end of which .take(5).do(...). But take does not work, does not take the first 5 elements, but skips everything that came to it, further. Everything is connected, there are no errors/warnings in the console at all. What could be the problem?
getGithubAccounts(firstName: string): Observable<GithubAccount[]> {
return this.accountList ? Observable.of(this.accountList) :
this.init
.delay(this.delayTime)
.switchMap(() => this._http.get(`${this.githubUrl}${firstName}`))
.map(list => list.json().items)
.take(5)
.do(accountList => this.accountList = accountList);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question