You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Due to the signal lifetime semantics we currently have, signal of composed properties could have a potential to leak if either:
It is repeatedly called; or
It is called but left unused.
Consider the following snippet:
let mapped = property.map { $0 + 1 }
for _ in 0 ..< 100000 {
_ = mapped.signal
}
It would create 100000 signals from the property that would live as long as property.
Note that even if we share the signal across invocations, the lifetime issue of such signal still persists, since the current semantics of Signal is purely emitter-controlled and push-driven.
Due to the signal lifetime semantics we currently have,
signal
of composed properties could have a potential to leak if either:Consider the following snippet:
It would create 100000 signals from the property that would live as long as
property
.Note that even if we share the signal across invocations, the lifetime issue of such
signal
still persists, since the current semantics ofSignal
is purely emitter-controlled and push-driven.We should revisit this after #3075 concludes. 🎄
The text was updated successfully, but these errors were encountered: