title: RxSwift callback return first before result
body: <p>I am using Firebase FirAuth API and before the API return result, Disposables.create() has been returned and it's no longer clickable (I know this might due to no observer.onCompleted after the API was called. Is there a way to wait for it/ listen to the result?</p>
  
  <pre><code>public func login(_ email: String, _ password: String) -&gt; Observable&lt;APIResponseResult&gt; {
  
      let observable = Observable&lt;APIResponseResult&gt;.create { observer -&gt; Disposable in
  
          let completion : (FIRUser?, Error?) -&gt; Void =  {  (user, error) in
  
              if let error = error {
                  UserSession.default.clearSession()
                  observer.onError(APIResponseResult.Failure(error))
                  observer.on(.completed)
                  return
              }
  
              UserSession.default.user.value = user!
              observer.onNext(APIResponseResult.Success)
              observer.on(.completed)
              return
          }
  
          DispatchQueue.main.async {
              FIRAuth.auth()?.signIn(withEmail: email, password: password, completion: completion)
          }
  
          return Disposables.create()
      }
  
      return observable
  
  }
  </code></pre>