osm-auth icon indicating copy to clipboard operation
osm-auth copied to clipboard

[DOC] Invalid description of API

Open gander opened this issue 1 year ago • 3 comments

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.

gander avatar May 25 '24 20:05 gander

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

bhousel avatar May 28 '24 21:05 bhousel

☠️ is it alive?

gander avatar Aug 20 '25 17:08 gander

☠️ is it alive?

yes

bhousel avatar Aug 20 '25 18:08 bhousel