Comments (3)
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.
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.
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)
- PascalCase compatibility layer HOT 2
- Move Heartbeat changed listening to Roact HOT 3
- loggerMiddleware should throw if given invalid arguments HOT 4
- Expunge remaining references to bin scripts
- Use arguments to debug.traceback to improve `NoYield` output HOT 1
- Middlewares are applied in last-in-first-out order HOT 2
- Deprecate 'changed' and introduce new store update signal HOT 2
- Add Rodux.createAction HOT 4
- Don't fire update if the top-level state doesn't change after a reducer HOT 2
- Lift restriction on subscribers yielding
- If the initialState argument of createReducer is nil, then its actionHandlers are never called. HOT 2
- Add the ability to access state from other scripts HOT 2
- Rename root folder from lib to src
- Update docs to fix reducer page HOT 1
- Add a Signal.Destroy method HOT 1
- Store.spec.lua has an undestructed store
- Don't pretty-print tables in loggerMiddleware.lua
- Expose store `ACTION_LOG_LENGTH` as a user-settable param, and add a `:clearLog` method to the store
- Update version and make new release or tag HOT 3
- Continue execution after error is thrown while flushing store updates HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rodux.