Interested in reading more of my articles? If yes, you may want to sign up for my newsletter at https://stackfull.dev . It would help me notify you whenever I jot down the next thought.
For anyone interested in digging react and Redux a bit deeper, you may find this project interesting Redux Box , it's been starred 550+ times in last 3-4 months.
PRs are more than welcome, specially for documentation. I would love to join any discussions regarding this too.
Striving to become a master Go/Cloud developer; Father ๐จโ๐งโ๐ฆ; ๐ค/((Full Stack Web|Unity3D) + Developer)/g; Science supporter ๐ฉโ๐ฌ; https://coder.today
Sorry to bother, but isn't the fact that you bring all the stores into a global entity brakes the entire purpose of modules in the first place?
Beside the obvious reasons (global and singleton are bad), the box it is a single point of failure, how can you do the tests of a view (you can inject a module or you have to inject a box and a module?).
Interested in reading more of my articles? If yes, you may want to sign up for my newsletter at https://stackfull.dev . It would help me notify you whenever I jot down the next thought.
Hey Adrian,
Thanks for asking. Redux box uses redux under the hood, as implied by the name itself. So it adheres to all the principles that redux is based upon, the 'single store' being one of them. However, redux doesn't force you to implement your whole store as a single module or single reducer. It's possible to organize your store in the modular fashion, which offers some great advantages:
1) Expressive and organized codebase - For example, you can split your giant e-commerce logic in separate modules like profileModule, searchModule, orderModule, historyModule etc. It just makes a lot more sense than organizing files by types.
2) When you get an error in your actions/sagas/mutations you can figure out the module in the error stack trace.
3) It makes code reusability across platforms easier. For example, if there's module (say profileModule) to be used across web and mobile app, you can use the same module in two apps without any change.
Apart from modularity redux-box offers some other features, like handling immutability (so you can use push, pop, etc in your reducers without causing any side effects), it makes the whole store setup process a breeze, you literally set up the store for your application in less than 10 lines of code etc.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
For anyone interested in digging react and Redux a bit deeper, you may find this project interesting Redux Box , it's been starred 550+ times in last 3-4 months.
PRs are more than welcome, specially for documentation. I would love to join any discussions regarding this too.
Sorry to bother, but isn't the fact that you bring all the stores into a global entity brakes the entire purpose of modules in the first place?
Beside the obvious reasons (global and singleton are bad), the box it is a single point of failure, how can you do the tests of a view (you can inject a module or you have to inject a box and a module?).
Hey Adrian,
Thanks for asking. Redux box uses redux under the hood, as implied by the name itself. So it adheres to all the principles that redux is based upon, the 'single store' being one of them. However, redux doesn't force you to implement your whole store as a single module or single reducer. It's possible to organize your store in the modular fashion, which offers some great advantages:
1) Expressive and organized codebase - For example, you can split your giant e-commerce logic in separate modules like profileModule, searchModule, orderModule, historyModule etc. It just makes a lot more sense than organizing files by types.
2) When you get an error in your actions/sagas/mutations you can figure out the module in the error stack trace.
3) It makes code reusability across platforms easier. For example, if there's module (say profileModule) to be used across web and mobile app, you can use the same module in two apps without any change.
Apart from modularity redux-box offers some other features, like handling immutability (so you can use push, pop, etc in your reducers without causing any side effects), it makes the whole store setup process a breeze, you literally set up the store for your application in less than 10 lines of code etc.