I changed my code to:
var validatedEMail: AnyPublisher<String?, Never> {
return $eMail
.debounce(for: 0.5, scheduler: RunLoop.main)
.removeDuplicates()
.map { username in
return Future { promise in
self.usernameAvailable(username) { available in
promise(.success(available ? username : nil))
}
}
}
.switchToLatest()
.eraseToAnyPublisher()
}
but this didn't help the issue: the validatedEMail
Publisher still works as expected but the validatedCredentials
Publisher still doesn't fire if both other Publishers did.
So I opened