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

Kinda leak inside of map #68

Closed
wclr opened this issue Jul 5, 2016 · 2 comments
Closed

Kinda leak inside of map #68

wclr opened this issue Jul 5, 2016 · 2 comments

Comments

@wclr
Copy link
Contributor

wclr commented Jul 5, 2016

import xs from 'xstream'

let A = xs.periodic(100)
let B = xs.periodic(200)

// A.withLatestFrom(B, (a, b) => a + b)
let C = B.map(b => A.map(a => a + b).debug('A')).flatten().take(1)

C.addListener({
  next: (c) => console.log('C', c),
  error: () => {},
  complete: () => {}
})

Output:

A: 0
C: 0
A: 1
A: 2
A: 3
...

http://www.webpackbin.com/EkUus9V8W

if .take(2) it doesn't leak.

staltz added a commit that referenced this issue Jul 5, 2016
The listener of an inner stream in a flatten() was not necessarily being removed when the flatten
operator/producer was stopped, causing a leak. This commit fixes that leak.

Fixes issue #68.
@staltz
Copy link
Owner

staltz commented Jul 5, 2016

This was a bug in flatten() actually. Just fixed it. Will release v5.1.1 soon.

@staltz
Copy link
Owner

staltz commented Jul 5, 2016

@staltz staltz closed this as completed Jul 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants