Giter Site home page Giter Site logo

Comments (3)

LPGhatguy avatar LPGhatguy commented on May 27, 2024

Ooh, that's an oversight.

Should the initial action go through middleware? If so, I wonder if it should be a string like @@INIT like Redux to make it serializable.

from rodux.

AmaranthineCodices avatar AmaranthineCodices commented on May 27, 2024

I'm honestly not sure. I think it depends on how crucial we consider the initialization action. Middleware can outright cancel an action (in my implementation, at least), or tamper with it in any number of ways. If the initialization action is considered a "absolutely must be dispatched" sort of thing, then no, the initialization action should not go through the middleware.

from rodux.

LPGhatguy avatar LPGhatguy commented on May 27, 2024

I dug through all of the conversations the Redux team had about their initial action dispatching and how it relates to middleware, and I don´t think it needs to run through middleware.

In the worst case, if your middleware needs some sort of state, you can instantiate it:

local middlewareInstance = middleware({ options })
local store = Store.new(reducer, nil, { middlewareInstance })

I'll go ahead and fix this, since it's pretty easy to patch up and shouldn't cause conflicts with any existing PRs.

from rodux.

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.