Coder Social home page Coder Social logo

Comments (4)

romanenko avatar romanenko commented on May 15, 2024

After some investigation I began to get issue a bit better now. Return value from dispatch(action) calls are undefined because actions aren't dispatched immediately during store rehydration — they are getting queued by bufferActions().

I was implementing isomorphic app, and this behaviour caused problems, when I tried to wait for data-fetching from async actions to be done before rendering. I omitted redux-persist initialization in node environment and now my issues are gone.

But, still, maybe, we should return action from dispatch() after queueing its actual dispatching?

from redux-persist.

rt2zz avatar rt2zz commented on May 15, 2024

@romanenko generally redux-persist should be disabled on server since the model does not usually make sense for single use stores. That said I would like to best and most generically support all use cases. It may make sense to either turn off bufferActions or at least make it a configurable option.

Because at the point that bufferActions has a chance to work is typically before other middleware has operated, we have no way to return the actual expected return value.

from redux-persist.

rt2zz avatar rt2zz commented on May 15, 2024

Ok, having thought more about this I am going to remove bufferActions in v3. I will cut a preliminary release soon.

from redux-persist.

rt2zz avatar rt2zz commented on May 15, 2024

v3 is available sans the action buffer via npm i --save redux-persist@next warning: may be highly unstable

from redux-persist.

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.