瀏覽代碼

Backport PR #12199: Add note about `async`, `await` and `Promises` in the extension tutorial (#12207)

Co-authored-by: Jeremy Tuloup <jeremy.tuloup@gmail.com>
MeeseeksMachine 3 年之前
父節點
當前提交
5abe7f6983
共有 1 個文件被更改,包括 9 次插入0 次删除
  1. 9 0
      docs/source/extension/extension_tutorial.rst

+ 9 - 0
docs/source/extension/extension_tutorial.rst

@@ -457,6 +457,15 @@ And update the ``activate`` method to be ``async`` since we are now using
 
         activate: async (app: JupyterFrontEnd, palette: ICommandPalette) =>
 
+.. note::
+
+    If you are new to JavaScript / TypeScript and want to learn more about ``async``, ``await``,
+    and ``Promises``, you can check out the following `tutorial on MDN <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Promises>`_
+
+    Be sure to also refer to the other resources in the
+    `See Also <https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Promises#see_also>`_
+    section for more materials.
+
 Rebuild your extension if necessary (``jlpm run build``), refresh your browser
 tab, and run the *Random Astronomy Picture* command again. You should now see a
 picture in the panel when it opens (if that random date had a picture and not a