Closed nvartolomei closed 8 years ago
i wanna see code without ugly action type constant, without ugly switch
@hermaproditus https://github.com/acdlite/redux-actions
@LubergAlexander to be honest, redux-actions solution is less than satisfactory, if your using alt before
@hermaproditus I don't find type constants or switches ugly. In fact I think it's as close to pattern matching as we can get without building too many abstractions. You can always abstract them away if you need it. Not that anybody is stopping you from doing so. I tried several abstraction methods and ended up just using constants and switch blocks. It's clear and easy to debug. I guess the point I want to make is it's really a matter of preference. As far as I understand the point of this repo is to show some advanced use cases in the most general way. Abstractions you can build on top of it are up to you.
Agreed with all of @alexeygolev points! Closing this for now, happy to talk more about this if need be though.
@EricSimons have you read issue text?
I agree completely with @alexeygolev, the code style should be of no concern for this repo. The one chosen is used by the official Redux examples to.
This issue shouldn't be closed though, since the original question by @nvartolomei wasn't related to that at all!
Oops, I viewed this on mobile and missed the initial comments - I screwed up! It looks like you've had a good look at the codebase already @nvartolomei (editor race condition, etc) -- do you think the current functionality lacks the sort of info you're looking for? i.e. we already have comment population, showing latest articles, etc
@EricSimons I was looking for a case where you have 2 views for articles on the same page, for example the home view like it is now, and a widget with popular articles in a sidebar, under popular tags.
I'm wondering how would you implement an article list reducer and how would you reuse it.
cc @gaearon
I think we already have an article list component and corresponding reducers, are those not sufficient?
Also I would like to see here an example of displaying a sidebar with latest posts, or featured posts. Implemented with a multireducer or something like that.
Also maybe something like displaying recent comments, or on homepage show comments for each post.
I think this is great fit for using advanced patterns section.