Skip to content

Instantly share code, notes, and snippets.

@LanciWeb
Created November 28, 2020 16:56
Show Gist options
  • Select an option

  • Save LanciWeb/55d119877b717c020d9ba11fd86c45ac to your computer and use it in GitHub Desktop.

Select an option

Save LanciWeb/55d119877b717c020d9ba11fd86c45ac to your computer and use it in GitHub Desktop.
Wiring up redux thunk
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { createStore, applyMiddleware } from 'redux'; //applyMiddleware comes from redux
import { Provider } from 'react-redux';
import reducers from './reducers';
import thunk from 'redux-thunk';
const store = createStore(combinedReducers, applyMiddleware(thunk)); //applyMuddleware adds thunk to the store
ReactDOM.render(
<Provider store={store}>
<App />
</Provider>,
document.getElementById('root')
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment