{"size": 779, "ext": "js", "max_stars_repo_path": "rejection/store/store.js", "max_stars_repo_name": "oliver-day/rejection", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "rejection/store/store.js", "max_issues_repo_name": "oliver-day/rejection", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "rejection/store/store.js", "max_forks_repo_name": "oliver-day/rejection", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 26.8620689655, "max_line_length": 113, "alphanum_fraction": 0.6842105263}
import { createStore, applyMiddleware, compose } from 'redux';
import createSagaMiddleware from 'redux-saga';
import { Provider } from 'react-redux';

import rootReducer from './reducers';
import rootSaga from './sagas';

const composeEnhancers = typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;

const sagaMiddleware = createSagaMiddleware();
const middleware = [sagaMiddleware];

export const store = createStore(
    rootReducer,
    composeEnhancers(applyMiddleware(...middleware))
);
sagaMiddleware.run(rootSaga);


export const withRedux = Component => {
    return function withRedux (props) {
        return (
            <Provider store={store}>
                <Component {...props}/>
            </Provider>
        );
    }
};
