10 ms·
Well, there are several problems here. While you are correct, that we don't really have tools which will automatically create constants or generate a reducer ba
by bloomca 9y ago
Well, there are several problems here. While you are correct, that we don't really have tools which will automatically create constants or generate a reducer based on them, I personally don't think that it is a right direction.
First of all, there are too many tools around. So, unless it will be really popular, it will be achievable only in couple of most-popuplar editors. Secondly, there are some things which this approach won't solve -- for instance, universal approach to caching and merging data in reducer (it can be done via some helper functions, but you still will have a lot of boilerplate).
And also, some things are just hard to do -- for instance, combining reducers with decent amount of granularity and complexity of maintaining it later. Also, here I provide a way to do prefetching for server-side rendering, which is another problem you'd have to solve.