-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Refactor and deduplicate logic in Users/Sessions Routers. #375
Conversation
nlutsenko
commented
Feb 12, 2016
- Refactored users.js into UsersRouter
- Refactored sessions.js into SessionsRouter
- Deduplicated a lot of logic that is shared with ClassesRouter
- Updated to ES6 style
b5576a7
to
9b5f3e6
Compare
9b5f3e6
to
9ced7aa
Compare
@nlutsenko updated the pull request. |
|
||
getExpressRouter() { | ||
let router = new PromiseRouter(); | ||
router.route('GET', '/users', (req) => { return this.handleFind(req); }); |
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.
Some slightly terser versions would be router.route('GET', '/users', req => this.handleFind(req));
or router.route('GET', '/users', this.handleFind.bind(this));
if you prefer
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.
Love the former, will update then.
9ced7aa
to
b2570a9
Compare
@nlutsenko updated the pull request. |
Refactor and deduplicate logic in Users/Sessions Routers.