Code Monkey home page Code Monkey logo

Comments (4)

Velenir avatar Velenir commented on July 25, 2024 3

Do you mean you import a state from a state.json file? Are you using redux-devtools-extension? If yes, give serialize.immutable option a try.

If you are only using pure redux-devtools, then you are only making your workflow more difficult than it needs to be. In that case you'll have to use its store enhancer like this. Also, I think, you'll have to serialize/deserialize Immutable collections yourself.

Also it seems to me you're trying to use your fixer function as a store enhancer to wrap state on each dispatch. You probably meant to employ a middleware here with applyMiddleware.

Actually, you won't need to go as far as resorting to middleware -- it is much more reasonable to just always work with Immutable data inside your reducers/initialState.

from redux-immutable.

BATMAH69 avatar BATMAH69 commented on July 25, 2024

Thank you for the detailed answer.
Yes, it was about redux-devtools-extension in this case and serialize.immutable option solve my problem.

It might be useful to add a link to answer in warning message, to simplify the search.

Add error text for search engine:
The previous state received by the reducer is of unexpected type. Expected argument to be an instance of Immutable.Iterable with the following properties
inputState.withMutations is not a function

from redux-immutable.

gajus avatar gajus commented on July 25, 2024

Thank you @Velenir.

from redux-immutable.

zcmgyu avatar zcmgyu commented on July 25, 2024

In my case, initialState in createStore is still is Object
const store = createStore(
reducer,
Immutable.Map({}), // THIS WOULD FIX MY PROBLEM
applyMiddleware(thunk, logger)
);

from redux-immutable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.