osm-auth
osm-auth copied to clipboard
[DOC] Invalid description of API
Correctly marked
-
.xhr(options, callback)wherecallbackarguments areerrorandresult(xhr.responseXMLorxhr.response) -
.fetch(resource, options)where success isresultor throwserror.
Incorrectly marked
-
.authenticate(callback)wherecallbackarguments should be marked aserrorandself. -
.authenticateAsync()where success should be marked asselfor throwserror. -
.bootstrapToken(auth_code, callback)wherecallbackarguments should be marked aserrorandself.
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.
Thanks for this feedback - I'd always welcome a Pull Request to make our docs easier to understand.
☠️ is it alive?
☠️ is it alive?
yes