Created
October 29, 2016 23:36
-
-
Save pke/02b263b79f4ea71bfbe903c1989803ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, applyMiddleware } from "redux" | |
import createSagaMiddleware from 'redux-saga' | |
import { composeWithDevTools } from 'redux-devtools-extension/developmentOnly' | |
import logger from 'redux-logger' | |
import reducer from './reducers' | |
import saga from './sagas' | |
export default function configureStore(initialState) { | |
const sagaMiddleware = createSagaMiddleware() | |
const store = createStore( | |
reducer, initialState, composeWithDevTools(applyMiddleware( | |
sagaMiddleware, logger() | |
)) | |
) | |
sagaMiddleware.run(saga) | |
//__DEV__ && (window.store = store) | |
return store | |
} | |
const position = (state = INITIAL.position, action) => { | |
switch (action.type) { | |
case GEOLOCATION_UPDATE: | |
debugger | |
return [action.payload.coords.latitude, action.payload.coords.longitude] | |
default: | |
return state | |
} | |
} | |
const select = ({position}) => { | |
debugger | |
return { | |
position | |
} | |
} | |
export default connect(select)(App) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment