diff options
author | Michael Foiani <mfoiani2019@communityschoolnaples.org> | 2018-07-26 00:31:25 -0400 |
---|---|---|
committer | Michael Foiani <mfoiani2019@communityschoolnaples.org> | 2018-07-26 00:31:25 -0400 |
commit | f0815df6642642db3e5063b6800d2ed0f681754c (patch) | |
tree | 54fe65f3ddcffcc2c0524c64bf8e54a66c97779e /src/reducers/firebase.js | |
parent | 2b253a35d7f33a256cf52d555ce5ca39206c7bb2 (diff) |
Created basic login system using firebase and redux.
Diffstat (limited to 'src/reducers/firebase.js')
-rw-r--r-- | src/reducers/firebase.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/src/reducers/firebase.js b/src/reducers/firebase.js new file mode 100644 index 0000000..2c7ba56 --- /dev/null +++ b/src/reducers/firebase.js @@ -0,0 +1,36 @@ +/** +@license +Copyright (c) 2018 The Polymer Project Authors. All rights reserved. +This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt +The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt +The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt +Code distributed by Google as part of the polymer project is also +subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt +*/ + +import { AUTH_FAIL, AUTH_SUCCESS } from '../actions/firebase.js'; + +const firebase = (state = {initialized: false}, action) => { + switch (action.type) { + case AUTH_SUCCESS: + alert(action.payload); + return { + ...state, + initialized: action.payload + }; + break; + + case AUTH_FAIL: + alert(action.payload); + return { + ...state, + initialized: action.payload + }; + break; + + default: + return state; + } +}; + +export default firebase; |