Update
This commit is contained in:
parent
981819454a
commit
99660143ab
|
@ -49,7 +49,7 @@ Promise.join(
|
||||||
Use `.all`, `.any`, `.race`, or `.some`.
|
Use `.all`, `.any`, `.race`, or `.some`.
|
||||||
|
|
||||||
```js
|
```js
|
||||||
Promise.all([ pro1, pro2 ])
|
Promise.all([ promise1, promise2 ])
|
||||||
.then(function (results) {
|
.then(function (results) {
|
||||||
results[0]
|
results[0]
|
||||||
results[1]
|
results[1]
|
||||||
|
@ -57,7 +57,8 @@ Promise.all([ pro1, pro2 ])
|
||||||
|
|
||||||
// succeeds if one succeeds first
|
// succeeds if one succeeds first
|
||||||
Promise.any(promises)
|
Promise.any(promises)
|
||||||
.then(...)
|
.then(function (result) {
|
||||||
|
})
|
||||||
```
|
```
|
||||||
|
|
||||||
### Object
|
### Object
|
||||||
|
|
|
@ -36,12 +36,12 @@ var promises = [
|
||||||
|
|
||||||
// succeeds when all succeed
|
// succeeds when all succeed
|
||||||
Promise.all(promises)
|
Promise.all(promises)
|
||||||
.then(function (values) {
|
.then(function (results) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// succeeds when one finishes first
|
// succeeds when one finishes first
|
||||||
Promise.race(promises)
|
Promise.race(promises)
|
||||||
.then(function (value) {
|
.then(function (result) {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,11 @@
|
||||||
---
|
---
|
||||||
title: "Shell: named pipes"
|
title: "Shell: named pipes"
|
||||||
layout: default
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
```sh
|
||||||
diff <(ls ./old) <(ls ./new)
|
diff <(ls ./old) <(ls ./new)
|
||||||
|
```
|
||||||
|
|
||||||
|
## References
|
||||||
|
|
||||||
|
* [Named pipe](https://en.wikipedia.org/wiki/Named_pipe) (wikipedia.org)
|
||||||
|
|
8
sh.md
8
sh.md
|
@ -1,5 +1,5 @@
|
||||||
---
|
---
|
||||||
title: Shell scripting (bash)
|
title: Bash scripting
|
||||||
layout: default
|
layout: default
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -233,5 +233,7 @@ or
|
||||||
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do; case $1 in
|
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do; case $1 in
|
||||||
esac; shift; done
|
esac; shift; done
|
||||||
|
|
||||||
* http://wiki.bash-hackers.org/
|
## Reference
|
||||||
* http://wiki.bash-hackers.org/syntax/shellvars
|
|
||||||
|
* [Bash-hackers wiki](http://wiki.bash-hackers.org/) (back-hackers.org)
|
||||||
|
* [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) (back-hackers.org)
|
||||||
|
|
Loading…
Reference in New Issue