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
I've been hunting memory leaks in my app this week, and I think I've tracked one down to Kefir. It seems that flatMap will unsubscribe once take(1) is done, but then resubscribes again, even though it should now be inactive.
I'm using 1.3.1, not sure if this bug is in v2.
This code will reproduce the problem:
varsubCount=0,unsubCount=0;varu=kefir.fromBinder(function(em){subCount++;em.emit(1);returnfunction(){unsubCount++;}})vars=kefir.fromBinder(function(em){em.emit(1);}).flatMap(function(){returnu;}).take(1);vardata=[],ended=false;s.onAny(function(ev){if(ev.type==='value')data.push(ev.value);elseif(ev.type==='end')ended=true;});data.should.eql([1]);ended.should.be.ok;// subCount = 2, but unsubCount = 1unsubCount.should.equal(subCount);
The text was updated successfully, but these errors were encountered:
* master:
cleanup repository after release
2.0.1
update changelog
remove not used variables in tests
fix bug "flatMap with take(1) doesn't unsubscribe" (fix#92)
minor grammar fixes in bacon-vs-kefir doc
update bacon-vs-kefir doc
Hi,
I've been hunting memory leaks in my app this week, and I think I've tracked one down to Kefir. It seems that flatMap will unsubscribe once take(1) is done, but then resubscribes again, even though it should now be inactive.
I'm using 1.3.1, not sure if this bug is in v2.
This code will reproduce the problem:
The text was updated successfully, but these errors were encountered: