-
Notifications
You must be signed in to change notification settings - Fork 119
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
Query Builder options #28
Conversation
bd5f3c0
to
5239c2b
Compare
5239c2b
to
40dd484
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't it be better to expose the two methods instead of one method for both?
Hmmmm I dunno, I like the one method approach. I did export 2 declares though so it's like one method for 2 types? https://github.com/nestjsx/nestjs-typeorm-paginate/pull/28/files#diff-eb13222256edaba485eae8aeb826bc78R10 typeorm does it a lot so wanted to give it a go :p what do you think? @shekohex |
I just don't like the monomorphism and polymorphism in general and i always try to avoid them when possible. |
SOLID 😉 There are several pros when your methods follow a single responsibility pattern. My favorite one is testing. But, of course, there are situations when you really can't (read |
i would also have used 2 different methods.. but i guess this is a highly opinionated topic :D |
ok so 2 separate method. I liked the double export though 😂 never mind. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. I have no issue with the polymorphism since the code has been kept trivial and easily testable.
I prefer when it respect the single responsibility principle, but that’s my point of view ^^ |
I do prefer polymorphism since it makes the API more concise. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay i have no problem at all 😊
Instead of only being limited to repositories, you an pass in a query builder to return the pagination object
#24