Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

takeLast bug #1407

Closed
staltz opened this issue Mar 1, 2016 · 3 comments · Fixed by #1412
Closed

takeLast bug #1407

staltz opened this issue Mar 1, 2016 · 3 comments · Fixed by #1412

Comments

@staltz
Copy link
Member

staltz commented Mar 1, 2016

var foo = Rx.Observable.interval(1000);

var bar = foo.take(5).takeLast(3);

bar.subscribe(
  function (x) { console.log('next ' + x); },
  function (err) { console.log('error ' + err); },
  function () { console.log('done'); },
);

This outputs:

"next 3"
"next 4"
"next 2"
"done"

When it should output

"next 2"
"next 3"
"next 4"
"done"

Happened with beta.2


And

var bar = foo.take(5).takeLast(2);

Caused output

"next 4"
"next undefined"
"done"
@benlesh
Copy link
Member

benlesh commented Mar 2, 2016

lol... weird. I'm a little shocked that even the basic tests didn't catch that.

kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 2, 2016
@staltz
Copy link
Member Author

staltz commented Mar 2, 2016

Me too

@lock
Copy link

lock bot commented Jun 7, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jun 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants