You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2019/11/21 12:16:31 UTC

[GitHub] [cordova] raphinesse opened a new issue #175: Use async functions wherever applicable

raphinesse opened a new issue #175: Use async functions wherever applicable
URL: https://github.com/apache/cordova/issues/175
 
 
   Using the `async` keyword ensures that a function will **always** return a Promise. Previously this was achieved by wrapping the function body in `return Promise.resolve().then(…)` which has a very slight async penalty and can make stack traces harder to read.
   
   ### Definition of done
   For all known asynchronous functions:
     - add `async` keyword
     - undo wrapping in `Promise.resolve().then(…)` if applicable
     - undo any explicit result wrapping
       `return Promise.resolve(…)` ⮕ `return …`
     - throw errors instead of returning rejections
       `return Promise.reject(new Error(…))` ⮕ `throw new Error(…)`
     - _optional:_ use `await` & `try/catch` in the function body instead of traditional promise handling
   
   ## Task list
   
   ### Tools/libs
   - [ ] cordova-cli
   - [ ] cordova-lib
   - [ ] cordova-create
   - [ ] cordova-fetch
   - [ ] cordova-common
   - [ ] cordova-serve
   - [ ] cordova-js (only the Node.js part)
   
   ### Platforms (only the Node.js part)
   - [ ] cordova-android
   - [ ] cordova-browser
   - [ ] cordova-ios
   - [ ] cordova-windows

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org