We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e1c324 commit 73328c7Copy full SHA for 73328c7
1.md
@@ -0,0 +1,16 @@
1
+# 维护下载数据
2
+
3
+下载数据包括
4
+1. task
5
+2. task中的fileList
6
+3. fileList每个item的属性,状态
7
8
+# 任务在哪里处理
9
10
+特性:
11
+1. 任务启动后与页面无关,后台执行
12
+2. 登录后需要检查任务,并判断是否执行
13
14
+# 主流程
15
16
+1.
1.ts
async/promise.md
@@ -0,0 +1,29 @@
+# Promise
+## 创建Promise
+```js
+const a = new Promise((resolve, reject) => {
+ // 执行异步任务
+ if (a) {
+ resolve(1)
+ } else (
+ reject(1)
+ )
+})
+```
+## resolve & reject
17
18
+resolve: 表示调用成功
19
20
+## then(success, fail)
21
22
+当调用`then`的`promise`成功,执行了`resolve`,函数就会走到这里的`success`
23
24
+当执行了`reject`,或者抛出了异常,函数就会走到这里的`fail`
25
26
+## catch(e => void)
27
+catch(failureCallback) 是 then(null, failureCallback)的缩写
28
29
+通常用于在链式调用的最后捕捉异常
0 commit comments