From f0815df6642642db3e5063b6800d2ed0f681754c Mon Sep 17 00:00:00 2001 From: Michael Foiani Date: Thu, 26 Jul 2018 00:31:25 -0400 Subject: Created basic login system using firebase and redux. --- src/reducers/firebase.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 src/reducers/firebase.js (limited to 'src/reducers') 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; -- cgit v1.2.3-70-g09d2