Skip to content

Commit aa12f53

Browse files
authored
Update flow.md
1 parent b33a1e8 commit aa12f53

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

topics/flow.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,3 +109,16 @@ serialProcess([1,2,3,4,5], (el, index, list, done) => {
109109
}, el*100);
110110
}).then((list) => console.log(list)); // [1,4,9,16,25]
111111
```
112+
in callback style
113+
114+
```javascript
115+
serialProcess([1,2,3,4,5], (el, index, list, done) => {
116+
console.log(`${el} start`);
117+
setTimeout(() => {
118+
console.log(`${el} end`);
119+
done(el*el);
120+
}, el*100);
121+
},
122+
(list) => console.log(list)
123+
); // [1,4,9,16,25]
124+
```

0 commit comments

Comments
 (0)