We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7592d43 commit c44b2c7Copy full SHA for c44b2c7
README.md
@@ -282,6 +282,25 @@ export default connect(
282
)(SandwichShop);
283
```
284
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
304
## License
305
306
MIT
0 commit comments