|
@@ -5,17 +5,27 @@ import createSagaMiddleware from "redux-saga";
|
|
import combinedReducers from './../reducers';
|
|
import combinedReducers from './../reducers';
|
|
import initialState from './../reducers/initialState'
|
|
import initialState from './../reducers/initialState'
|
|
import saga from './../saga'
|
|
import saga from './../saga'
|
|
-import { auth } from './../firebase_config'
|
|
|
|
|
|
+import { auth, database } from './../firebase_config'
|
|
import { userIsNotSignedIn, userIsSignedIn } from './../actions/auth/signIn'
|
|
import { userIsNotSignedIn, userIsSignedIn } from './../actions/auth/signIn'
|
|
|
|
+import { actionChannel } from 'redux-saga/effects';
|
|
|
|
|
|
const sagaMiddleware = createSagaMiddleware();
|
|
const sagaMiddleware = createSagaMiddleware();
|
|
|
|
|
|
-const store = createStore(
|
|
|
|
|
|
+const store = createStore(
|
|
combinedReducers,
|
|
combinedReducers,
|
|
initialState,
|
|
initialState,
|
|
applyMiddleware(sagaMiddleware, logger)
|
|
applyMiddleware(sagaMiddleware, logger)
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+const action = payload =>({
|
|
|
|
+ type: 'TEST_FB_REQUEST',
|
|
|
|
+ payload
|
|
|
|
+})
|
|
|
|
+
|
|
|
|
+const usersRef = database.ref('/users')
|
|
|
|
+
|
|
|
|
+usersRef.on('child_added' , snapshot => store.dispatch(action(snapshot.val())))
|
|
|
|
+
|
|
export default store;
|
|
export default store;
|
|
|
|
|
|
sagaMiddleware.run(saga);
|
|
sagaMiddleware.run(saga);
|