April 2017
Intermediate to advanced
414 pages
8h 14m
English
To set up our store, we will need to use Redux's createStore method and then pass it a reducer. Here's how it looks on a high level:
let store = createStore(task)
Additionally, since we know we'll be dealing with asynchronous calls in our application, we should also set up Redux-Thunk to support it.
To do so, pass the applyMiddleware function as the second argument to createStore. Pass thunk as an argument for applyMiddleware:
let store = createStore(listOfTasks, applyMiddleware(thunk));
Finally, we'll export a stateless function that returns our app container wrapped around the Provider:
export default function Tasks (props) {
return (
<Provider store={ store }>
<AppContainer />
</Provider>
)
}
In total, here's ...
Read now
Unlock full access