代码从火力3个文档https://firebase.google.com/docs/auth/web/manage-users#get_the_currently_signed-in_user如何火力认证工作
firebase.auth().onAuthStateChanged(function(user){
if (user) {
// If there's a user take him to the home page.
this.rootPage = HomePage;
} else {
// If there's no user logged in send him to the LoginPage
this.rootPage = LoginPage;
}
});
是如何user
参数在观察者设定又是怎样从以上这下面不同的代码?
从教程代码@http://javebratt.com/firebase-3-email-auth/
firebase.auth().onAuthStateChanged((user) => {
if (user) {
// If there's a user take him to the home page.
this.rootPage = HomePage;
} else {
// If there's no user logged in send him to the LoginPage
this.rootPage = LoginPage;
}
});
的原因,我问的是,我经历一个教程离子2和火力点3和firebase.auth().onAuthStateChanged()
实现是从什么是正式明显不同docs for firebase 3
感谢@MattHannam您的解释看起来是针对最近弃用的Firebase 2 – user1841445