You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// rootReducer.js// this reducer is made for syncing firestore data with state// it has access to the fbConfig passed in through index.jsimport{firestoreReducer}from'redux-firestore'//firestoreReducer syncs properties in the state to the data in the databaseconstrootReducer=combineReducers({auth: authReducer,project: projectReducer,firestore: firestoreReducer})
// Dashboard.jsconstmapStateToProps=state=>{return{projects: state.firestore.ordered.projects}}// compose: multiple HOCexportdefaultcompose(connect(mapStateToProps),firestoreConnect(()=>['projects']),)(Dashboard)// firestore connect takes array of collections// induces firestore reducer above to sync data
// rootReducerimport{firebaseReducer}from'react-redux-firebase'constrootReducer=combineReducers({// which reducers we want to combine and what we want to call them
...
firebase: firebaseReducer,})