Merge pull request #5235 from spalger/styleguideClarification

added promise example to the "Chaining operations" section of the styleguide
This commit is contained in:
Rashid Khan 2015-11-02 09:06:45 -07:00
commit c6791486ce

View file

@ -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>
...