Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why the whole Animals "inheritance" thing? #41

Open
natchiketa opened this issue Jun 5, 2017 · 1 comment
Open

Why the whole Animals "inheritance" thing? #41

natchiketa opened this issue Jun 5, 2017 · 1 comment

Comments

@natchiketa
Copy link

natchiketa commented Jun 5, 2017

First off, thanks to the maintainers of this example for everything you've done. You've saved me a lot of time in my AngularJS+ng-redux to Angular+angular-redux/store+TypeScript upgrade!

I'm curious as to the reasoning behind the choice to have the example use this pattern of having Elephant and Lion sort of "inherit" from Animal. It's been my experience that whenever I've tried, in actual client work, to apply inheritance somewhere, the children end up diverging, and I end up regretting it.

So I think the pattern is not a common use case, and more importantly, it creates an obstacle toward the goal of this codebase, that is, to understand how to use angular-redux.

While this abstraction is fascinating, I would really prefer to lose one of the animals and just see an implementation where one of the two has its own components, actions, epics, reducer, service, etc.

If you're open to this, I would absolutely be willing to do the work myself and submit a PR.

@SethDavenport
Copy link
Member

SethDavenport commented Jun 6, 2017

Yeah the two pages are a bit redundant. We could probably stand to lose one. I'm with you about inheritance, although technically this is more akin to genericity instead which has fewer problems: effectively the pattern is more like AnimalList<Lion> and AnimalList<Elephant>, where Lion and Elephant aren't really related to each other, beyond implementing the same basic interface.

I'm happy to review a PR if you're up for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants