Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Fixes #23574 - add selector to facts charts using reselect #5778
@amirfefer I really like it!
I think we should discuss about strategies and naming conventions for selectors.
This is what I came with:
I'n not sure about the
referenced this pull request
Jul 8, 2018
ik5 left a comment
I think that selectors should have their own directory.
Inside it can be either by sub directory for a subject, or just the name of the selector.
The reason for it is to easier find and understand what belongs to where, even in a year from now, instead of looking just at the charts component for example.
at least my opinion in the matter.
@ik5 we went into this way before with the actions and the reducers and it feelt difficult to develop and maintain in this way.
@sharvit okay, let's flow with that blog post, your structure is still not as it was suggested.
You went for a structure with actions and reducers, and now you are breaking it, and doing so with no order at all, and that render the ability to maintain code for someone that does not live in 24/7 and now exactly what to expect every second a nightmare.
Also, take in consideration that even you, will not remember every such decision for long term. That is, you might remember that you created something, but not where it is, and what was the function name, or file name, and now what?
So when going on a structure, regardless of what the structure is, it is better to keep up with it, for not having a mess.
Think of Principle of least astonishment. It is okay to have
The division is less a concern, but components cannot be a root for everything else, it is driven by context.
So we should use a foreman domain driven structure, for example the usage of that chars, and then sub directory for selectors for example, so it will be easier to figure it out.
My 2 cents on the matter.
@ik5 I can totally understand why you feel it is a nightmare and we need to better in this field.
I don't think we should move the selectors to
@sharvit I'm not sure that placing a selector under a component is a right way.
So having a scope, for example
If now you'll want to reuse just this component, but with new data, you actually made a more complex move, because you are tying yourself to that selector inside that component.