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

Refactor and deduplicate logic in Users/Sessions Routers. #375

Merged
merged 3 commits into from
Feb 12, 2016

Conversation

nlutsenko
Copy link
Contributor

  • Refactored users.js into UsersRouter
  • Refactored sessions.js into SessionsRouter
  • Deduplicated a lot of logic that is shared with ClassesRouter
  • Updated to ES6 style

@nlutsenko nlutsenko force-pushed the nlutsenko.router.users branch from b5576a7 to 9b5f3e6 Compare February 12, 2016 04:05
@nlutsenko nlutsenko changed the title Refactor and deduplicate logic in UsersRouter. Refactor and deduplicate logic in Users/Sessions Routers.. Feb 12, 2016
@nlutsenko nlutsenko changed the title Refactor and deduplicate logic in Users/Sessions Routers.. Refactor and deduplicate logic in Users/Sessions Routers. Feb 12, 2016
@nlutsenko nlutsenko force-pushed the nlutsenko.router.users branch from 9b5f3e6 to 9ced7aa Compare February 12, 2016 05:04
@facebook-github-bot
Copy link

@nlutsenko updated the pull request.


getExpressRouter() {
let router = new PromiseRouter();
router.route('GET', '/users', (req) => { return this.handleFind(req); });
Copy link
Contributor

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

Copy link
Contributor Author

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.

@nlutsenko nlutsenko force-pushed the nlutsenko.router.users branch from 9ced7aa to b2570a9 Compare February 12, 2016 07:17
@facebook-github-bot
Copy link

@nlutsenko updated the pull request.

nlutsenko added a commit that referenced this pull request Feb 12, 2016
Refactor and deduplicate logic in Users/Sessions Routers.
@nlutsenko nlutsenko merged commit 04f2a57 into master Feb 12, 2016
@nlutsenko nlutsenko deleted the nlutsenko.router.users branch February 12, 2016 07:26
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

Successfully merging this pull request may close these issues.

3 participants