Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit 8f55136

Browse files
committed
Update README.md
Removed ES6
1 parent 9012c91 commit 8f55136

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

README.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ Find things!:
105105
```js
106106
mention.findChoices = function(match) {
107107
// Matches items from search query
108-
return [/* choices */]
109-
.filter( choice => ~this.label(choice).indexOf(match[1]) );
108+
return [/* choices */].filter(function(choice) {
109+
return ~this.label(choice).indexOf(match[1]);
110+
});
110111
}
111112
```
112113

@@ -128,16 +129,21 @@ mention.findChoices = function(match) {
128129
Hate redundancy? De-dupe that shiznizzle:
129130
```js
130131
mention.findChoices = function(match, mentions) {
131-
return [ /* choices */ ]
132-
.filter( choice => !mentions.some( mention => mention.id === choice.id ) )
132+
return [ /* choices */ ].filter(function(choice) {
133+
return !mentions.some(function(mention) {
134+
return mention.id === choice.id;
135+
});
136+
});
133137
};
134138
```
135139

136140
Use the awesome power of the internet:
137141
```js
138142
mention.findChoices = function(match) {
139143
return $http.get('/users', { params: { q: match[1] } })
140-
.then( response => response.data );
144+
.then(function(response) {
145+
return response.data;
146+
});
141147
}
142148
```
143149

@@ -146,7 +152,7 @@ Your servers are slow? Mama please.
146152
mention.findChoices = function(match) {
147153
mention.loading = true;
148154
return $http.get(...)
149-
.finally( response => {
155+
.finally(function(response) {
150156
mention.loading = false;
151157
});
152158
}

0 commit comments

Comments
 (0)