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

windowToggle bug in WindowToggleSubscriber#closeWindow #1487

Closed
staltz opened this issue Mar 18, 2016 · 2 comments
Closed

windowToggle bug in WindowToggleSubscriber#closeWindow #1487

staltz opened this issue Mar 18, 2016 · 2 comments
Labels
bug Confirmed bug help wanted Issues we wouldn't mind assistance with.

Comments

@staltz
Copy link
Member

staltz commented Mar 18, 2016

RxJS version: 5.0.0-beta.2

Code to reproduce:

var clicks = Rx.Observable.fromEvent(document, 'click');
var openings = Rx.Observable.interval(1000);
var result = clicks.windowToggle(openings, i =>
  i % 2 ? Rx.Observable.interval(500) : Rx.Observable.empty()
).mergeAll();
result.subscribe(x => console.log(x));

Expected behavior:
No error thrown, some messages in the console when the user clicks.

Actual behavior:
Uncaught TypeError: Cannot read property 'window' of undefined after 1 second.

Additional information:
Seems to happen in WindowToggleSubscriber#closeWindow.

JSBin: http://jsbin.com/zenelokita/1/edit?html,js,output

@staltz staltz changed the title windowToggle bug windowToggle bug in WindowToggleSubscriber#closeWindow Mar 18, 2016
@benlesh benlesh added bug Confirmed bug help wanted Issues we wouldn't mind assistance with. priority: high labels Mar 18, 2016
@benlesh
Copy link
Member

benlesh commented Mar 18, 2016

Good catch

kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 18, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 19, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 19, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 19, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 21, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 21, 2016
@kwonoj kwonoj closed this as completed in c755587 Mar 22, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 23, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 27, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Mar 28, 2016
kwonoj added a commit to kwonoj/rxjs that referenced this issue Apr 1, 2016
@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
bug Confirmed bug help wanted Issues we wouldn't mind assistance with.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants