You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current Behavior
Each returned Subject on windowToggle continues forever after closingSelector emits when the closingSelector is a stream from another windowToggle.
Reproduction
// <div id="zone1"><div id="zone2"></div></div>constzone1=document.getElementById("zone1")// not nullconstzone2=document.getElementById("zone2")// not nullconstzone1Down=fromEvent(zone1,'mousedown')constzone1Move=fromEvent(zone1,'mousemove')constzone1Up=fromEvent(zone1,'mouseup')constzone2Move=fromEvent(zone2,'mousemove')constzone1Window=merge(zone1Down,zone1Move,zone1Up).pipe(windowToggle(zone1Down,(_: any)=>zone1Up)).pipe(share())constopener=zone1Window.pipe(map(s=>s.pipe(take(1)))// take the first in each windowed stream.pipe(flatMap(e=>e))constcloser=zone1Window.pipe(map(s=>s.pipe(takeLast(1)))// take the last in each windowed stream.pipe(flatMap(e=>e))// The issue happens herezone2Move.pipe(windowToggle(opener,(_: any)=>closer)).pipe(flatMap(e=>e)).subscribe(console.log)
When the zone1 div is clicked down and held then zone2Move starts emitting movement from zone2 div. All good. Releasing the mouse to activate zone1Up to emit, which causes the closer to emit which should cause the subject emitted by zone2Move to stop emitting, but the subject continues to emit.
Exhibits the correct behavior. Subjects from zone2Move stop emitting after zone1Up emits. But I don't see the difference between the two windowing methods. zone1Down and opener are emitting the same thing, same time. As are zone1Up and closer. This leads me to believe there is inconsistent behavior with windowToggle
Environment
Runtime: Chrome 79.0.3945.79
RxJS version: 6.5.3
The text was updated successfully, but these errors were encountered:
Can the example be simplified? I don't understand why the zone1Down, zone1Move and zone1Up observables are merged here. There will be two subscription to the zone1Down: for the source in the merge and for the opening notifier to windowToggle.
Why is this necessary? What behaviour were you expecting to see here?
Bug Report
Current Behavior
Each returned
Subject
onwindowToggle
continues forever after closingSelector emits when the closingSelector is a stream from another windowToggle.Reproduction
When the zone1 div is clicked down and held then
zone2Move
starts emitting movement from zone2 div. All good. Releasing the mouse to activatezone1Up
to emit, which causes thecloser
to emit which should cause the subject emitted byzone2Move
to stop emitting, but the subject continues to emit.Changing the last
windowToggle
code to thisExhibits the correct behavior. Subjects from
zone2Move
stop emitting afterzone1Up
emits. But I don't see the difference between the two windowing methods.zone1Down
andopener
are emitting the same thing, same time. As arezone1Up
andcloser
. This leads me to believe there is inconsistent behavior withwindowToggle
Environment
The text was updated successfully, but these errors were encountered: