Skip to content
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

Trouble using enhancers router, thunk #15

Open
cramatt opened this issue Dec 3, 2017 · 2 comments
Open

Trouble using enhancers router, thunk #15

cramatt opened this issue Dec 3, 2017 · 2 comments

Comments

@cramatt
Copy link

cramatt commented Dec 3, 2017

I have gotten this to work at a basic level. But, after I add router and thunk enhancers, I get the following error:

inputState.withMutations is not a function
TypeError: inputState.withMutations is not a function

Here is roughly my store:

    const reducer = asyncInitialState.outerReducer(rootReducer);
    const initialState = compose(applyMiddleware(asyncInitialState.middleware(loadStore.bind(null, storeUrl))));
    const enhancer = composeEnhancers(applyMiddleware(thunk, router));
    return createStore(
        reducer,
        initialState,
        enhancer
    );
@cramatt
Copy link
Author

cramatt commented Dec 3, 2017

Looks like the issues stems from using redux-immutable, which expects initial state to be instance of Immutable, so in this libraries case we return a Promise which results in error.

https://github.com/gajus/redux-immutable#problem

@KELiON
Copy link
Owner

KELiON commented Feb 2, 2018

@cramatt can you also attach loadStore function? I suppose you're resolving Promise with object, but in your case it should be resolved with the instance of some Immutable object

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants