Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1c972d5

Browse files
author
Nathan Chapman
committed
Remove failed chaining
1 parent e431d81 commit 1c972d5

File tree

2 files changed

+10
-48
lines changed

2 files changed

+10
-48
lines changed

‎README.md‎

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
## Snippets
44

5-
Snippets are optimized to be short and easy to remember. Some snippets are "chainable" and render differently when preceded by a [period](https://en.wikipedia.org/wiki/Full_stop).
6-
7-
For example, `.fe` renders a chain-friendly version of the "forEach" snippet, while `fe` renders a full code block.
5+
Snippets are optimized to be short and easy to remember.
86

97
Below is a list of all available snippets and the triggers of each one. The **** means the `TAB` key.
108

@@ -231,35 +229,35 @@ function* ${1:name}(${2:arguments}) {
231229
[...Array(${1:length}).keys()]${0}
232230
```
233231

234-
#### `fe⇥` forEach loop (chainable)
232+
#### `fe⇥` forEach loop
235233
```javascript
236234
${1:iterable}.forEach((${2:item}) => {
237235
${0}
238236
});
239237
```
240238

241-
#### `map⇥` map (chainable)
239+
#### `map⇥` map
242240
```javascript
243241
${1:iterable}.map((${2:item}) => {
244242
${0}
245243
});
246244
```
247245

248-
#### `reduce⇥` reduce (chainable)
246+
#### `reduce⇥` reduce
249247
```javascript
250248
${1:iterable}.reduce((${2:previous}, ${3:current}) => {
251249
${0}
252250
}${4:, initial});
253251
```
254252

255-
#### `filter⇥` filter (chainable)
253+
#### `filter⇥` filter
256254
```javascript
257255
${1:iterable}.filter(${2:item} => {
258256
${0}
259257
});
260258
```
261259

262-
#### `find⇥` find (chainable)
260+
#### `find⇥` find
263261
```javascript
264262
${1:iterable}.find(${2:item} => {
265263
${0}
@@ -349,7 +347,7 @@ var ${1:Class} = function(${2:arguments}) {
349347
};
350348
```
351349

352-
#### `proto⇥` prototype method (chainable)
350+
#### `proto⇥` prototype method
353351
```javascript
354352
${1:Class}.prototype.${2:method} = function(${3:arguments}) {
355353
${0}
@@ -405,14 +403,14 @@ new Promise((resolve, reject) => {
405403
})
406404
```
407405

408-
#### `then⇥` Promise.then (chainable)
406+
#### `then⇥` Promise.then
409407
```javascript
410408
${1:promise}.then((${2:value}) => {
411409
${0}
412410
})
413411
```
414412

415-
#### `catch⇥` Promise.catch (chainable)
413+
#### `catch⇥` Promise.catch
416414
```javascript
417415
${1:promise}.catch((${2:err}) => {
418416
${0}
@@ -478,7 +476,7 @@ module.exports = {
478476
};
479477
```
480478

481-
#### `on⇥` event handler (chainable)
479+
#### `on⇥` event handler
482480
```javascript
483481
${1:emitter}.on('${2:event}', (${3:arguments}) => {
484482
${0}

‎snippets/snippets.json‎

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -139,42 +139,22 @@
139139
"prefix": "fe",
140140
"body": "${1:iterable}.forEach((${2:item}) => {\n\t${0}\n});"
141141
},
142-
"chain forEach": {
143-
"prefix": ".fe",
144-
"body": ".forEach((${1:item}) => {${0}})"
145-
},
146142
"map": {
147143
"prefix": "map",
148144
"body": "${1:iterable}.map((${2:item}) => {\n\t${0}\n});"
149145
},
150-
"chain map": {
151-
"prefix": ".map",
152-
"body": ".map((${1:item}) => {${0}})"
153-
},
154146
"reduce": {
155147
"prefix": "reduce",
156148
"body": "${1:iterable}.reduce((${2:previous}, ${3:current}) => {\n\t${0}\n}${4:, initial});"
157149
},
158-
"chain reduce": {
159-
"prefix": ".reduce",
160-
"body": ".reduce((${1:previous}, ${2:current}) => {${0}}${4:, initial})"
161-
},
162150
"filter": {
163151
"prefix": "filter",
164152
"body": "${1:iterable}.filter(${2:item} => {\n\t${0}\n});"
165153
},
166-
"chain filter": {
167-
"prefix": ".filter",
168-
"body": ".filter((${1:item}) => {${0}})"
169-
},
170154
"find": {
171155
"prefix": "find",
172156
"body": "${1:iterable}.find(${2:item} => {\n\t${0}\n});"
173157
},
174-
"chain find": {
175-
"prefix": ".find",
176-
"body": ".find((${1:item}) => {${0}})"
177-
},
178158
// Objects and Classes
179159
"object literal": {
180160
"prefix": "ol",
@@ -224,10 +204,6 @@
224204
"prefix": "proto",
225205
"body": "${1:Class}.prototype.${2:method} = function(${3:arguments}) {\n\t${0}\n};"
226206
},
227-
"chain prototype method": {
228-
"prefix": ".proto",
229-
"body": ".prototype.${2:methodName} = (${3:arguments}) => {\n\t${0}\n}"
230-
},
231207
"Object.assign": {
232208
"prefix": "oa",
233209
"body": "Object.assign(${1:dest}, ${2:source})"
@@ -267,18 +243,10 @@
267243
"prefix": "then",
268244
"body": "${1:promise}.then((${2:value}) => {\n\t${0}\n})"
269245
},
270-
"chain Promise.then": {
271-
"prefix": ".then",
272-
"body": ".then((${1:value}) => {${0}})"
273-
},
274246
"Promise.catch": {
275247
"prefix": "catch",
276248
"body": "${1:promise}.catch((${2:err}) => {\n\t${0}\n})"
277249
},
278-
"chain Promise.catch": {
279-
"prefix": ".catch",
280-
"body": ".catch((${1:err}) => {${0}})"
281-
},
282250
// ES6 Modules
283251
"export (ES6)": {
284252
"prefix": "ex",
@@ -329,10 +297,6 @@
329297
"prefix": "on",
330298
"body": "${1:emitter}.on('${2:event}', (${3:arguments}) => {\n\t${0}\n});"
331299
},
332-
"chain event handler": {
333-
"prefix": ".on",
334-
"body": ".on('${2:event}', (${3:arguments}) => {${0}});"
335-
},
336300
// BDD Testing (Mocha, Jasmine, etc.)
337301
"describe": {
338302
"prefix": "desc",

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /