Skip to content

Commit

Permalink
optimize await usage
Browse files Browse the repository at this point in the history
  • Loading branch information
zoux committed Aug 30, 2018
1 parent 7fc4e8f commit d6fd4ae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion JS/JS-br.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ var obj = {a: 1, b: {
}}
// pay attention that this method is asynchronous
// it can handle `undefined` and circular reference object
const clone = await structuralClone(obj);
(async () => {
const clone = await structuralClone(obj)
})()
```
# Modularization
Expand Down
4 changes: 3 additions & 1 deletion JS/JS-ch.md
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ var obj = {a: 1, b: {
}}
// 注意该方法是异步的
// 可以处理 undefined 和循环引用对象
const clone = await structuralClone(obj);
(async () => {
const clone = await structuralClone(obj)
})()
```

# 模块化
Expand Down
4 changes: 3 additions & 1 deletion JS/JS-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,9 @@ var obj = {a: 1, b: {
}}
// pay attention that this method is asynchronous
// it can handle `undefined` and circular reference object
const clone = await structuralClone(obj);
(async () => {
const clone = await structuralClone(obj)
})()
```
# Modularization
Expand Down

0 comments on commit d6fd4ae

Please sign in to comment.