Skip to content

Instantly share code, notes, and snippets.

@pfulop
Created February 7, 2017 19:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pfulop/63a098e4c01a638a5f16c0037cfde4c6 to your computer and use it in GitHub Desktop.
Save pfulop/63a098e4c01a638a5f16c0037cfde4c6 to your computer and use it in GitHub Desktop.
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