diff options
author | Fabio Berger <me@fabioberger.com> | 2018-07-10 01:05:38 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-07-10 01:05:38 +0800 |
commit | 324b1079e7eb29829bf06ff65299acdc58abf308 (patch) | |
tree | b03cc6abb6cf5595bef75609a82664855db1ad7a /packages/website/md/docs/0xjs/async.md | |
parent | a9b320e636850693edd535da20ce7e5ec949926e (diff) | |
download | dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar.gz dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar.bz2 dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar.lz dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar.xz dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.tar.zst dexon-sol-tools-324b1079e7eb29829bf06ff65299acdc58abf308.zip |
Add ability to nest doc ref markdown under specific versions
Diffstat (limited to 'packages/website/md/docs/0xjs/async.md')
-rw-r--r-- | packages/website/md/docs/0xjs/async.md | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/packages/website/md/docs/0xjs/async.md b/packages/website/md/docs/0xjs/async.md deleted file mode 100644 index 8abaef331..000000000 --- a/packages/website/md/docs/0xjs/async.md +++ /dev/null @@ -1,26 +0,0 @@ -0x.js is a promise-based library. This means that whenever an asynchronous call is required, the library method will return a native Javascript promise. You can therefore choose between using `promise` or `async/await` syntax when calling our async methods. - -_Async/await syntax (recommended):_ - -```javascript -try { - var availableAddresses = await zeroEx.getAvailableAddressesAsync(); -} catch (error) { - console.log('Caught error: ', error); -} -``` - -_Promise syntax:_ - -```javascript -zeroEx - .getAvailableAddressesAsync() - .then(function(availableAddresses) { - console.log(availableAddresses); - }) - .catch(function(error) { - console.log('Caught error: ', error); - }); -``` - -As is the convention with promise-based libraries, if an error occurs, it is thrown. It is the callers responsibility to catch thrown errors and to handle them appropriately. |