diff options
| author | Christophe Simonis <chs@odoo.com> | 2019-09-24 16:59:15 +0000 |
|---|---|---|
| committer | Christophe Simonis <chs@odoo.com> | 2019-09-24 17:45:37 +0000 |
| commit | d67b2483e5bfa5d8c1e6ef1a64fb933f5e080ad5 (patch) | |
| tree | 25a7fd39ac993f3c04c5d8408beb628b3c9948ce /doc/reference/javascript_cheatsheet.rst | |
| parent | 38d8b0526f0fccc32df5a11f5d086a3522ed5fcf (diff) | |
| parent | 9ed4872ea03f28012118ed48a43d0800617a84f3 (diff) | |
[MERGE] forward port branch saas-12.4 up to 9ed4872ea03
closes odoo/odoo#37372
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'doc/reference/javascript_cheatsheet.rst')
| -rw-r--r-- | doc/reference/javascript_cheatsheet.rst | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/doc/reference/javascript_cheatsheet.rst b/doc/reference/javascript_cheatsheet.rst index 97f7ba5cb5c..b6c5251c46c 100644 --- a/doc/reference/javascript_cheatsheet.rst +++ b/doc/reference/javascript_cheatsheet.rst @@ -1,5 +1,7 @@ :banner: banners/javascript.jpg +.. _reference/jscs: + ===================== Javascript Cheatsheet ===================== @@ -280,6 +282,7 @@ using the view in the kanban arch (a specific example is the helpdesk dashboard) Promises and asynchronous code =============================== + For a very good and complete introduction to promises, please read this excellent article https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch3.md Creating new Promises @@ -418,6 +421,7 @@ Waiting for Promises Error handling -------------- + - in general in promises The general idea is that a promise should not be rejected for control flow, but should only be rejected for errors. When that is the case, you would have multiple resolutions of your promise with, for instance status codes that you would have to check in the `then` handlers and a single `catch` handler at the end of the promise chain. @@ -540,4 +544,4 @@ Testing asynchronous code }); }); - as you can see, the nicer form is to use `async/await` as it is clearer and shorter to write.
\ No newline at end of file + as you can see, the nicer form is to use `async/await` as it is clearer and shorter to write. |
