-
Notifications
You must be signed in to change notification settings - Fork 115
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
where should i put my enhancers? #24
Comments
Thanks for the question @geminiyellow , it is a really good one. We will push an update to allow this scenario, please give us a day or two. |
woo, thank you @navneet-g . ok , two ; ) . |
Just a quick update, I have started a small refacotr/redesign to better support it, the changes are in following branch, I need to test them out and write some test harness. I hope to get some time over the weekend to finish it off, but no promise :) |
@geminiyellow I have a PR out to support enhancers. Thanks for requesting this feature it helped me improve the design. To see how you can use it see the unit test where I am using moduleEnhancer with applyMiddleware enhancer |
woo, thank you @navneet-g |
@geminiyellow Published v2.0.0, which contains this new fix |
@geminiyellow did you get a chance to use v2.0.0? Please let us know if you have any feedback. |
hi @abettadapur , @navneet-g , sorry i have no time to test it yesterday. hmm, the i dont think that can help i understand how to use it. |
@geminiyellow I just published a new version (2.0.1)
|
@navneet-g good, thank you. let me try it. |
@geminiyellow I have also updated widgets example which now uses moduleEnhancer |
@navneet-g yes, i notice that, ok, here is my code
and i copy some code from
and put it in but when i start up it
|
@geminiyellow This error means that in the store there are some keys that do not have any associated reducers. Do you know how the reducers for offline, home, firebase and firestore are assigned? may be the enhancers for those middlewares provider the reducers. I suggest you try by changing the order for enhancers if you can create a minimal repro and provide me a gist to link to a github repo I can debug as well. |
@geminiyellow I was able to repro this and my analysis was correct above. e.g. const enhancers = [dynamicModuleEnhancer, firebaseEnhancer, middlewareEnhancer, offlineEnhancer]; |
I have also updated the widgets-example to illustrate the same and used offlineEnhancer as an example, please take a look here |
@navneet-g yes, i had try to change the order before comment. we can recreate it use the latest first , let us copy the code from redux official doc here: https://redux.js.org/api/combinereducers#example then add something like this: + const makeReducers = () => combineReducers({
+ todos,
+ counter
+ })
this.store = createStore(
+ makeReducers(),
- (state, action) => state || {}, and |
hi all, i use redux's
createStore
andcompose
like thisand in
redux-dynamic-modules
, i check the code, i can putmiddleware
in a new extension likeredux-dynamic-modules-thunk
, but where i should put the other enhancers?the
ModuleStore
only compose middleware ,https://github.com/Microsoft/redux-dynamic-modules/blob/10e7526f037dba0f1260a913f241504ea41f51ad/packages/redux-dynamic-modules/src/ModuleStore.ts#L43
am i wrong ?
The text was updated successfully, but these errors were encountered: