title: SwiftUI/Combine - Subscribing to the latest value of a single Publisher
body: <p>I'm playing around a tad with Combine and SwiftUI for a little pet project of mine, learning as I go.</p>
  
  <p>Here's the <code>LoginModel</code> at it current state:</p>
  
  <pre><code>public class LoginModel: ObservableObject {
      @Published var domain: String = ""
      @Published var email: String = ""
      @Published var password: String = ""
      @Published var isValid: Bool = false
      public var didChange = PassthroughSubject&lt;Void, Never&gt;()
  
      var credentialsValidPublisher: AnyPublisher&lt;Bool, Never&gt; {
          Publishers.CombineLatest($email, $password)
              .receive(on: RunLoop.main)
              .map { (email, password) in
                  let emailValid = String.emailValid(emailString: email) // String extension function
                  let passwordValid = password.count &gt; 5
                  return emailValid &amp;&amp; passwordValid
          }
          .breakpointOnError()
          .eraseToAnyPublisher()
      }
  
      init() {
          // This works just fine
          _ = credentialsValidPublisher.sink { isValid in
              self.isValid = isValid
          }
  
          // However this does not work at all
          _ = domain
              .publisher
              .receive(on: RunLoop.main)
              .sink { value in
                  print(value)
          }
      }
  }
  </code></pre>
  
  <p>Now from my current understanding is that a <code>@Published var foo: String</code> already has a <code>Publisher</code> attached to it. And that one should be able to use this directly to subscribe to its changes.</p>
  
  <p>Changing <code>credentialsValidPublisher</code> variable over to this works too:</p>
  
  <pre><code>var credentialsValidPublisher: AnyPublisher&lt;Bool, Never&gt; {
      Publishers.CombineLatest3($domain, $email, $password)
          .receive(on: RunLoop.main)
          .map { (domain, email, password) in
              let domainValid = URL.isValidURL(urlString: domain)
              let emailValid = String.emailValid(emailString: email)
              let passwordValid = password.count &gt; 5
              return domainValid &amp;&amp; emailValid &amp;&amp; passwordValid
      }
      .breakpointOnError()
      .eraseToAnyPublisher()
  }
  </code></pre>
  
  <p>But this is not what I want. In my case I need a special <code>Publisher</code> in order to map a valid URL string over to a network request and then ping the server at hand to see if the provided server is responding.</p>
  
  <p>Also this model is then connected to a SwiftUI view with a bunch of SwiftUI TextFields.
  Any help to point me in the right direction will be highly appreciated.</p>