Closed designeng closed 10 years ago
The stream created with asKefirStream
never ends. But it subscribes and unsubscribes to jQuery DOM events automatically when you subscribe / unsubscribe to stream itself (via .onValue
/ .offValue
for example). Is that what you want, or you want to actually end the stream?
If endless stream does not produce memory leaks, I think .offValue
is quite enough. Thank you!
Yes, I think it doesn't, i.e. when you remove the last link to the stream, and if it has no subscribers, it will be garbage collected completely.
Should I unbind jquery event or stop the stream observation on context destruction? Can be a stream created with asKefirStream function unbound manually? ... or https://github.com/pozadi/kefir/blob/master/dist/addons/kefir-jquery.js#L29 does all work?