Fix retain cycle

This commit is contained in:
David Langley
2021-09-08 16:37:56 +01:00
parent 15a7b43423
commit ad287d8dea

View File

@@ -39,7 +39,9 @@ class TemplateUserProfileViewModel: ObservableObject, TemplateUserProfileViewMod
userService.presencePublisher
.map(TemplateUserProfileStateAction.updatePresence)
.receive(on: DispatchQueue.main)
.sink(receiveValue: self.dispatch(action:))
.sink(receiveValue: { [weak self] action in
self?.dispatch(action:action)
})
.store(in: &cancellables)
}