{"size": 1179, "ext": "js", "max_stars_repo_path": "src/index.js", "max_stars_repo_name": "FDSoftware/PokeTest", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/index.js", "max_issues_repo_name": "FDSoftware/PokeTest", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/index.js", "max_forks_repo_name": "FDSoftware/PokeTest", "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": 21.4363636364, "max_line_length": 75, "alphanum_fraction": 0.6607294317}
// React / Redux / Saga:
import React from "react";
import ReactDOM from "react-dom";

import { createStore, applyMiddleware } from "redux";

import createSagaMiddleware from "redux-saga";
import reducer from "./reducers";
import { rootSaga } from "./saga";

//ReactUI
import Grid from "@material-ui/core/Grid";

//Componentes para UI:
import Header from "./components/Header";
import Pokemon from "./components/Pokemon";
import Loader from "./components/Loader";

// Redux / Saga init
const sagaMiddleware = createSagaMiddleware();
const store = createStore(reducer, applyMiddleware(sagaMiddleware));
sagaMiddleware.run(rootSaga);
const action = (type, payload) => store.dispatch({ type, payload });

function App() {
	return (
		<div>
			{store.getState().isLoading ? (
				<div>
					<Loader />
				</div>
			) : (
				<div/>
			)}

			<Header />
			<Grid container justify="center" alignItems="center" direction="column">
				<Grid item xs={12} sm={6} >
					<Pokemon
						store={store}
						action={action}
					/>
				</Grid>
			</Grid>
		</div>
	);
}

function render() {
	ReactDOM.render(<App />, document.getElementById("root"));
}

render();
store.subscribe(render);
