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

[Enhancement] Specify context for callbacks #44

Closed
wants to merge 1 commit into from
Closed

[Enhancement] Specify context for callbacks #44

wants to merge 1 commit into from

Conversation

billybonks
Copy link

i added functionality so that the callbacks from post and get are called
in the specified context, added the documentation to the read me.

i added functionality so that the callbacks from post and get are called
in the specified context
@criso
Copy link
Owner

criso commented Feb 3, 2014

This should be dealt with in userland. If you need access to the passed in access token, just wrap your call in a closure. https://stackoverflow.com/questions/2900839/how-to-structure-javascript-callback-so-that-function-scope-is-maintained-proper

@criso criso closed this Feb 3, 2014
@billybonks
Copy link
Author

for what reason should the user of the lib have to write more lines of code for every call if we can solve the problem in a few lines that gets reused everytime ?

@criso
Copy link
Owner

criso commented Feb 3, 2014

  1. Adds complexity to the lib.
  2. This won't work as you expect with graph.setContext() this.context is static. While a requests are being fired, it can still get altered. Only way to ensure that it works correctly would be to pass it in the get call etc..
  • Not trying to be a dick. I get your point and I appreciate you taking time to improve the lib. I just don't believe the juice is worth the squeeze.

@billybonks
Copy link
Author

np

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.

2 participants