onAuthStateChanged return unsubscribe, I want to return currentUser
问题 I am in an Angular project (6.0) using firebase (5.2). I am using the function: firebase.auth().onAuthStateChanged this function returns a firebase.Unsubscribe, which I don't master. I just know to work with Observables, Subjects and Promises. I would like to use this function as a observable, like, I subscribe to it whenever I get the currentUser back. So far, I've tried to wrap it a observable: auth.service.ts loadUser() { return Observable.create((observer: Observer<any>) => { firebase