manaflair / redux-batch

Enhance your Redux store to support batched actions
174 stars 12 forks source link

Example setting this up with @reduxjs/toolkit? #25

Open ChrisWiles opened 4 years ago

drydenwilliams commented 4 years ago

@ChrisWiles there is a little example here https://redux-toolkit.js.org/api/configureStore#full-example

aspiers commented 2 years ago

I had the same question, but those docs don't really shed much light. I tried

middleware: (getDefaultMiddleware) => getDefaultMiddleware().concat(reduxBatch),

and

middleware: (getDefaultMiddleware) => getDefaultMiddleware().prepend(reduxBatch),

which both resulted in a No overload matches this call error. Now I'm trying

enhancers: [reduxBatch]

but it's almost pure guesswork. I think this really should be documented, given how redux-toolkit is the recommended way to go these days.