Skip to content

Instantly share code, notes, and snippets.

Last active Apr 4, 2021
What would you like to do?
`AnyObject`-constrained `withLatestFrom` overload
extension Publisher where Self: AnyObject {
func withLatestFrom<Other: Publisher>(
_ other: Other
) -> AnyPublisher<Other.Output, Other.Failure>
where Failure == Other.Failure {
.map { [weak self] second in
self?.map { _ in second }.eraseToAnyPublisher() ??
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment