Skip to content

v2.1.0

Compare
Choose a tag to compare
@gaearon gaearon released this 10 May 15:13
· 166 commits to master since this release
  • Adds withExtraArgument for the cases when you want to inject a custom argument into all thunks. (#70)
const store = createStore(
  reducer,
  applyMiddleware(thunk.withExtraArgument(api))
)

// later
function fetchUser(id) {
  return (dispatch, getState, api) => {
    // you can use api here
  }
}