Closed emcniece closed 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.
In progress
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?