mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
added promise example to the "Chaining operations" section of the styleguide
This commit is contained in:
parent
c9c9e565e6
commit
ad3208a42a
1 changed files with 15 additions and 1 deletions
|
@ -505,6 +505,13 @@ d3.selectAll('g.bar')
|
|||
.each(function() ... )
|
||||
```
|
||||
|
||||
```js
|
||||
$http.get('/info')
|
||||
.then(({ data }) => this.transfromInfo(data))
|
||||
.then((transformed) => $http.post('/new-info', transformed))
|
||||
.then(({ data }) => console.log(data));
|
||||
```
|
||||
|
||||
*Wrong:*
|
||||
|
||||
```js
|
||||
|
@ -519,6 +526,13 @@ d3.selectAll('g.bar')
|
|||
.each(function() ... )
|
||||
```
|
||||
|
||||
```js
|
||||
$http.get('/info')
|
||||
.then(({ data }) => this.transfromInfo(data))
|
||||
.then((transformed) => $http.post('/new-info', transformed))
|
||||
.then(({ data }) => console.log(data));
|
||||
```
|
||||
|
||||
## Name your closures
|
||||
|
||||
Feel free to give your closures a descriptive name. It shows that you care about them, and
|
||||
|
@ -867,7 +881,7 @@ When a node has multiple attributes that would cause it to exceed the line chara
|
|||
attribute1="value1"
|
||||
attribute2="value2"
|
||||
attribute3="value3">
|
||||
|
||||
|
||||
<li></li>
|
||||
<li></li>
|
||||
...
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue