Skip to content

Commit c44b2c7

Browse files
committed
Update README.md
1 parent 7592d43 commit c44b2c7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,25 @@ export default connect(
282282
)(SandwichShop);
283283
```
284284

285+
## Injecting a Custom Argument
286+
287+
Since 2.1.0, Redux Thunk supports injecting a custom argument using the `withExtraArgument` function:
288+
289+
```js
290+
const store = createStore(
291+
reducer,
292+
applyMiddleware(thunk.withExtraArgument(api))
293+
)
294+
295+
// later
296+
function fetchUser(id) {
297+
return (dispatch, getState, api) => {
298+
// you can use api here
299+
}
300+
}
301+
```
302+
303+
285304
## License
286305

287306
MIT

0 commit comments

Comments
 (0)