Inside my authProvider
provider class, I have the following method:
retrieveUser() {
return this.afAuth.authState.subscribe(user => {
return user;
});
}
I am looking to subscribe to this method in a different class. Here is an example of how I envision it:
this.authProvider.retrieveUser().subscribe(user => console.log(user));
Any suggestions on how I can modify the retrieveUser()
method to return an Observable
instead?