You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Basically, the types of configureStore should match pretty closely the types of Redux's StoreCreator. A fully typed example of a call to createStore would look like this:
I'm a bit hesitant to explicitly add an option for this directly to configureStore itself, for a couple reasons:
RSK aims to have the most common usages handled by default
If you need to customize the default middleware, you can override the middleware argument and pass in your own list. That would include a customized thunk instance
Conversely, it's also possible that people might have excluded the thunk middleware from the store setup, so that option might not apply.
Typings-wise, what happens if you do something like middleware: [thunk.withExtraArgument(someArg)] ? How does the resulting store type come out?
Related to #113, I would love the ability to provide an extra thunk argument via an
extraThunkArgument
option toconfigureStore
.The result of the thunk should be of the following type:
Basically, the types of
configureStore
should match pretty closely the types of Redux's StoreCreator. A fully typed example of a call tocreateStore
would look like this:Furthermore, there should be a good strategy for mocking this store, perhaps with a similar approach to
@jedmao/redux-mock-store
?This, however, would be a separate dev dependency and perhaps a separate GitHub issue as well.
The text was updated successfully, but these errors were encountered: