summaryrefslogtreecommitdiff
path: root/doc/reference/javascript_cheatsheet.rst
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2019-09-23 17:40:06 +0000
committerChristophe Simonis <chs@odoo.com>2019-09-24 09:44:56 +0000
commitac4fc6e7c7d71c3f8e2440a8ed8095c5aab15dd8 (patch)
treee143d6d261f22cb06f2c0d5b344a4353e5b3be1b /doc/reference/javascript_cheatsheet.rst
parenta6a3df3d0eda0fc2476c59de61d59534815f7c20 (diff)
parentbd3e510edbcd62f508dae28f573ee4d1a51bcf87 (diff)
[MERGE] forward port branch saas-12.3 up to bd3e510edbc
closes odoo/odoo#37314 Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'doc/reference/javascript_cheatsheet.rst')
-rw-r--r--doc/reference/javascript_cheatsheet.rst6
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.