refactor(user.model.spec): reduce callback hell#1150
Closed
deltreey wants to merge 2 commits intoangular-fullstack:canaryfrom
Closed
refactor(user.model.spec): reduce callback hell#1150deltreey wants to merge 2 commits intoangular-fullstack:canaryfrom
deltreey wants to merge 2 commits intoangular-fullstack:canaryfrom
Conversation
by passing functions and reducing function wrapping we can keep complexity low and make everything cleaner and more readable
Member
There was a problem hiding this comment.
@deltreey my apologies, I should have mentioned that the User methods will lose context to their parent object, so they'll need to be bound like: User.removeAsync.bind(User)
Collaborator
There was a problem hiding this comment.
Babel supports ::User.removeAsync too, right?
mongoose methods lose their context if you don't bind them
Author
|
this PR seems to be broken, I'm testing a bit, seeing if travis and my local box are not agreeing on stuff. hold off on merging this please :) |
Collaborator
|
I wouldn't really describe this as "callback hell", and could argue that this PR would add more complication |
Author
|
I agree. Should've abandoned this pull req a while ago |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
by passing functions and reducing function wrapping we can keep complexity low and make
everything cleaner and more readable
this is a small change, just the user model tests. If you guys like this style I can expand upon it, either making this PR larger or by making another. Let me know. 👍