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

[DOC] Invalid description of API #133

Open
gander opened this issue May 25, 2024 · 1 comment
Open

[DOC] Invalid description of API #133

gander opened this issue May 25, 2024 · 1 comment

Comments

@gander
Copy link

gander commented May 25, 2024

Correctly marked

  • .xhr(options, callback) where callback arguments are error and result ( xhr.responseXML or xhr.response)
  • .fetch(resource, options) where success is result or throws error.

Incorrectly marked

  • .authenticate(callback) where callback arguments should be marked as error and self.
  • .authenticateAsync() where success should be marked as self or throws error.
  • .bootstrapToken(auth_code, callback) where callback arguments should be marked as error and self.

Why?

In each of these functions success is marked as result, however this is not true. This unsystematic nature complicates learning how to use the library. If a function returns self, it should be written as self, and when it returns a request result, it should be written as result. This is clear, sensible, and lucid.

@bhousel
Copy link
Member

bhousel commented May 28, 2024

Thanks for this feedback - I'd always welcome a Pull Request to make our docs easier to understand.

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

No branches or pull requests

2 participants