Skip to content

Conversation

@danbell
Copy link
Contributor

@danbell danbell commented Jun 7, 2017

This PR allows "this" to be used within the model. This completes and obsoletes #320.

@cirick
Copy link

cirick commented Jun 15, 2017

I tested this change and it works for me as well. This change allows me to pass in class objects for the model and retain proper "this" context.

@cirick
Copy link

cirick commented Jun 23, 2017

@mjsalinger What do you think about this change?

@elmolicious
Copy link

This is feature I would love to see.

For anyone who wants to use a class for the model right now:

Currently a simple (but annoying) fix is to bind the model functions to the model context in the class constructor:

this.generateAuthorizationCode = this.generateAuthorizationCode.bind(this);

@mjsalinger
Copy link
Contributor

@danbell Can you rebase? I'll merge it if you do.

@danbell danbell force-pushed the feature/model-is-passed-this branch from 01e9a2b to 5f48a5c Compare August 4, 2017 03:38
@danbell
Copy link
Contributor Author

danbell commented Aug 4, 2017

@mjsalinger - done!

Copy link
Contributor

@mjsalinger mjsalinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mjsalinger mjsalinger merged commit bbb4f13 into oauthjs:master Aug 4, 2017
@danbell danbell deleted the feature/model-is-passed-this branch August 8, 2017 05:23
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.

4 participants