Open wgebczyk opened 9 years ago
Can you elaborate on this solution? Do you mean it as a workaround or something that could become a pull request?
bump
Leaks are a common problem with computed observables whose computation-functions read longer-lived observables. I'm not surprised this is also an issue with what are essentially computed arrays.
To eliminate leaks:
These steps are needed only because JavaScript lacks weak references. (JavaScript is getting WeakMap, but that's different from a weak reference. WeakMap cannot fix this kind of problem.)
@wgebczyk Noting what I said above about the two ways to avoid leaking memory with computed observables, your only option to prevent leaks with chained calls is to create these chained arrays as pure-computed (since you cannot call their dispose methods). I do not know if this is already a feature of this plugin. If not, then "pure-computed array projection" is the feature you should request.
Thanks! (from MrAndMrsK)
When using chained calls arr.filter(...).map(...) and disposing only last chain object it might leak memory. Solution is to intercept each call in chain and "dispose" them.