Created
February 7, 2017 19:59
-
-
Save pfulop/63a098e4c01a638a5f16c0037cfde4c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function checkUser() { | |
return (dispatch, getState, firebase) => { | |
firebase.auth().onAuthStateChanged((user) => { | |
if (user) { | |
dispatch({ type: LOGIN, user }); | |
} else { | |
dispatch({ type: LOGOUT }); | |
} | |
}); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment