title: Rxswift change value of observed object
body: <p>I am fairly new to Rx and to Reactive Programming in general. I am simply trying to make things work. I'm trying to populate an object after a request to an API (Github's API for the matter):</p>
  
  <p>The object to populate :</p>
  
  <pre><code>class GithubUser {
      var login: String?
      var joinDate: Date?
      var email: String?
  }
  </code></pre>
  
  <p>The way I try to feed it:</p>
  
  <pre><code>class GithubUserRepository {
      static func getUser() -&gt; Observable&lt;GithubUser&gt; {
          let userObservable = BehaviorRelay&lt;GithubUser&gt;(value: GithubUser())
          let login = "Thiryn"
          // GithubService.sharedInstance.getUser does whatever async call to the github API to get a user profile
          GithubService.sharedInstance.getUser(login, success: { (userProfile) in
              userObservable.value.login = login
              userObservable.value.email = userProfile.email
              userObservable.value.joinDate = userProfile.joinedDate
          }) { (error) in
              print(error.localizedDescription)
          }
          return userObservable.asObservable()
      }
  }
  </code></pre>
  
  <p>And how I try to consume</p>
  
  <pre><code>class ViewController: UIViewController {
  
      let disposeBag = DisposeBag()
  
      override func viewDidLoad() {
          super.viewDidLoad()
          GithubUserRepository.getUser().subscribe(onNext: { (user) in
              print(user.login ?? "nope")
          }).disposed(by: self.disposeBag)
      }
  }
  </code></pre>
  
  <p>The result is that I a "nope" the first time, before the request get executed, then I successfully get a result from my request, change the value of the object, but I might do something wrong as the subscribed function is never executed after.
  Any thoughts? Thanks!</p>
  
  <p>Edit : I based my try on the <a href="https://github.com/ReactiveX/RxSwift/blob/master/Documentation/Examples.md#reactive-values" rel="nofollow noreferrer">Reactive Values example from RxSwift</a></p>