Comments (7)
This is a really neat suggestion. I’m getting hung up a bit on the the DEFAULT name. Maybe PASSTHROUGH or NESTED or ELSE or maybe null
?
Thoughts?
from reduxsauce.
I'm not sure if nested is the only one use case.. for example the default handler could do something like:
const defaultHandler = (state, { type, payload }) => {
if (type.indexOf('FOO_') === 0) {
return { ...state, fooActionsCount: state.fooActionsCount + 1 };
}
return state;
}
This is certainly bad code, but just as idea, that default handler is not always delegate to nested reducers. I think DEFAULT
or ELSE
could work. But in "standard" reducer style you usually use default
keyword to mention, that this block handles all actions that are not mentioned above. So I think DEFAULT
should be the best name for the constant.
from reduxsauce.
I see where you’re coming from.
I’ve never written anything like that but I guess that could be useful.
I’d be ok with this. You up for a PR?
from reduxsauce.
done :)
from reduxsauce.
Nice! I've been researching redauxsauce for this case and was going to make PR like yours :)
I hope @skellock will merge it and publish soon this feature.
P.S. Also I'd like to ask @skellock why reduxsauce has redux package in dependencies. I didn't see any usages of redux package in code. Am I something losing sight?
from reduxsauce.
@skellock is there forecast when npm build with this will be released?
from reduxsauce.
Sorry for the delay. I have it merged into master, but wanted to test a few things to make sure we're good. I don't have a good ETA other than once these other fires are extinguished. =)
from reduxsauce.
Related Issues (20)
- createReducer with Typescript HOT 29
- How to handle extra logic using reduxsauce approach ? HOT 4
- Immutable is missing HOT 2
- How i can make code more clean with reduxsauce-typescript-immutable HOT 12
- The state is not updated HOT 2
- Multiple files uploading HOT 2
- typescript options prefix HOT 5
- Publish reduxsauce HOT 4
- How to use this with useDispatch (react-redux) HOT 1
- Documentation on how to use resettableReducer HOT 7
- I can not get 100% tests coverage HOT 2
- The reason you are no longer using it? HOT 3
- Reduxsauce cannot dispatch action HOT 2
- Reusable reducers HOT 6
- state.merge is not a function HOT 7
- repo createActions example error TypeScript HOT 2
- confused to use createTypes or createActions HOT 2
- how to use Creators or Types with intelligency for IDE HOT 7
- Action type does not support object as showed in the docs HOT 6
- minor enhancement to allow empty argument to actionCreator with defaults HOT 3
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 reduxsauce.