Jun 21, 2024
Unfortunately, the initial precept is wrong. If the sink captures self, then you have a strong reference cycle and the app won't crash when the object is "destroyed"... since it can't be destroyed.
The view could release the view model, but the strong cycle will ensure that it persists. Weak self fixes the problem but it is indeed troublesome if you forget... and cause a memory leak.
That's why moving past Combine into async/await is preferable as it avoids pesky closure captures.