kh90909 / OakTerm

Serial terminal for the Digistump Oak over the Particle Cloud
8 stars 2 forks source link

Stream subscription never ends #36

Closed emcniece closed 8 years ago

emcniece commented 8 years ago

Once a device is selected, the app subscribes to its deviceId stream... but this subscription doesn't stop. Subsequent device selections create new subscriptions, but the existing subscription listeners are still active. Not sure how to destroy event stream listeners at this point - should they be stacked in a object for destruction at a later point?

kh90909 commented 8 years ago

It looks like this a closing stream objects is a bit of a can of worms, but in practice I think what we need to do is store the stream object returned by the subscribe api call, then call stream.removeListener() or stream.removeAllListeners() to cancel the updates.

emcniece commented 8 years ago

In progress