Yes that’s my joke. Yes this is another article about differentiating redux and react.

Photo by Oskar Yildiz on Unsplash
componentDidMount() {fetch("http://localhost:3000/concerts").then(response => {return response.json();}).then((responseJSON) => {console.log(responseJSON);this.setState(() => {return {concerts: responseJSON}}, () => console.log(this.setState) )});});
componentDidMount() {
this.props.newFetchConcertsWithDispatchFn()
}
...const mdp = (globalDispatch) => {return {newFetchConcertsWithDispatchFn: () =>
globalDispatch(newFetchConcerts())
}}const msp = (globalState) => (globalState)export default connect(msp,mdp)(App);
export const addConcert = (concert) => ({ type: "ADD_CONCERTS", payload: concert})export const fetchConcerts = () => {return (dispatch) => {dispatch({ type: 'LOADING_CONCERTS'})fetch("http://localhost:3000/concerts").then(response => {return response.json()}).then(responseJSON => {// console.log(responseJSON)dispatch({ type: 'ADD_CONCERTS', concerts: responseJSON })})}}export const createConcert = (concert) => {return (dispatch) => {const configObj = {method: 'POST',headers: {"Content-Type": "application/json","Accepts": "application/json"},body: JSON.stringify(concert)}fetch("http://localhost:3000/concerts", configObj).then(res => res.json()).then(json => {dispatch(addConcert(json))})}}export const newFetchConcerts = () => {return (dispatch) => {dispatch({ type: 'LOADING_CONCERTS'})fetch("http://localhost:3000/concerts").then(response => {return response.json()}).then(responseJSON => {// console.log(responseJSON)dispatch({ type: 'ADD_CONCERTS', concerts: responseJSON })})}}
const concertsReducer = (state = { concerts: [], loading: false }, action) => {switch(action.type) {case 'LOADING_CONCERTS':return {...state,concerts: [...state.concerts],loading: true}case 'ADD_CONCERTS':return {...state,concerts: action.concerts,loading: false}case 'DELETE_CONCERT':return {concerts: state.concerts.filter(concert => concert.id !== action.payload.id),...state}default:return state;}}export default concertsReducer;

Software Developer and visual artist based in NYC. Join me on my journey to coding enlightenment or a torrential mental breakdown, whichever comes first.