{"size": 663, "ext": "js", "max_stars_repo_path": "react-Leonidas/redux/index.js", "max_stars_repo_name": "jhonnyagudelo/todosLosCursos", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "react-Leonidas/redux/index.js", "max_issues_repo_name": "jhonnyagudelo/todosLosCursos", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "react-Leonidas/redux/index.js", "max_forks_repo_name": "jhonnyagudelo/todosLosCursos", "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": 19.5, "max_line_length": 70, "alphanum_fraction": 0.6244343891}
const createStore = (reducer, inicialState) => {
  let state = inicialState;
  let updater = () => {};

  const getState = () => state;

  const dispach = (action) => {
    state = reducer(state, action);
    updater();
  };

  const susbcribe = (listener) => {
    updater = listener;
  };

  return {
    getState,
    dispach,
    susbcribe,
  };
};
const reducer = (state, action) => {
  return action;
};
const store = createStore(reducer, "estado inicial de la aplicacion");
//store.dispach
//store.getState
//store.subscribe

store.susbcribe(() => {
  console.log("ha cambiado algo en el store", store.getState());
});
store.dispach("voy a cambiar algo");
