backblaze-b2 icon indicating copy to clipboard operation
backblaze-b2 copied to clipboard

Improve README and Documentation

Open yakovkhalinsky opened this issue 10 years ago • 7 comments

The documentation and the README needs a bit of improvement.

yakovkhalinsky avatar Dec 03 '15 09:12 yakovkhalinsky

Do the promises still work (or only work?) the way as described in the README?

I am using the promises like so that seems to work also:

b2.functionName(payload)
    .then(callback)
    .catch(errorCallback);

EDIT: looks like this is somewhat explained in the 0.9.x to 1.0.x upgrade section.

ablankenship10 avatar Apr 23 '17 12:04 ablankenship10

Should do, if the promise ever resolves with an error(rejection).

The second arg in the .then(arg1, arg1) if a reject is ever called in the promise. It's of course optional.

The .catch() is also a feature of the promise, not something I've added in the README.

Might need a more comprehensive example at the top of the README probably to explain this.

yakovkhalinsky avatar Apr 23 '17 13:04 yakovkhalinsky

Relevant: #53

odensc avatar Jan 17 '19 21:01 odensc

I might look at making some nicer docs using GH pages so we can get a proper list of functions, and also add async/await as well as traditional Promise.then().catch()

Or should we just be documenting examples with async/await?

yakovkhalinsky avatar Jan 17 '19 21:01 yakovkhalinsky

I'd say just using asyn/await covers our basis

cbess avatar Jan 17 '19 21:01 cbess

Agreed - I think we should just use async/await for examples.

odensc avatar Jan 17 '19 22:01 odensc

this documentation is very poor. despite my years of using api. i still struggle to get things done. probably drop use case examples

Bimman2021 avatar Sep 20 '23 01:09 Bimman2021