Skip to content

Commit 8ae4722

Browse files
committed
change async arrow functions
1 parent 6802295 commit 8ae4722

File tree

6 files changed

+79
-83
lines changed

6 files changed

+79
-83
lines changed

.vscode/settings.json

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
{
22
"cSpell.words": [
3+
"aaafea",
4+
"aaf",
5+
"aafa",
6+
"aafad",
7+
"aafe",
8+
"aafea",
9+
"aafead",
10+
"aafii",
311
"afad",
412
"afeea",
513
"afer",
@@ -11,16 +19,6 @@
1119
"afpr",
1220
"afrd",
1321
"afrj",
14-
"aaf",
15-
"aafa",
16-
"aafad",
17-
"aafe",
18-
"aafea",
19-
"aafer",
20-
"aafera",
21-
"aafead",
22-
"aaafea",
23-
"aafii",
2422
"arfeq",
2523
"arfne",
2624
"arfoeq",
@@ -29,7 +27,6 @@
2927
"arsna",
3028
"arsnd",
3129
"aruv",
32-
"buymeacoffee",
3330
"caaf",
3431
"caaft",
3532
"caft",
@@ -42,10 +39,11 @@
4239
"edaf",
4340
"Eomm",
4441
"Equiman",
45-
"iiaf",
4642
"iiaaf",
47-
"patreon",
43+
"iiaf",
44+
"kural",
4845
"paypal",
46+
"pranav",
4947
"volta",
5048
"vuejs"
5149
],

CHANGELOG.md

Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -9,139 +9,143 @@ Fixed for any bug fixes.
99
Security to invite users to upgrade in case of vulnerabilities.
1010
-->
1111

12-
## [2.5.2] - 2022/07/06
12+
## 3.0.0 - 2022/10/18
1313

14-
### Fixed
14+
### Removed
15+
16+
- Snippets `afee` and `afeea` on arrow functions without return. Were replaced adding an extra step (with tab) on the other snippets that include return to easy delete if was need.
17+
18+
### Added
1519

16-
- Add sibling extension to README
20+
- Async-await arrow functions, by @pranav-kural
1721

18-
## [2.5.1] - 2022/06/23
22+
## 2.5.1 - 2022/06/23
1923

2024
### Fixed
2125

2226
- Support property on README
2327

24-
## [2.5.0] - 2022/06/23
28+
## 2.5.0 - 2022/06/23
2529

2630
### Added
2731

2832
- Support property
2933

30-
## [2.4.0] - 2022/05/19
34+
## 2.4.0 - 2022/05/19
3135

3236
### Changed
3337

3438
- unifying image
3539

36-
## [2.3.0] - 2022/05/05
40+
## 2.3.0 - 2022/05/05
3741

3842
### Changed
3943

4044
- `caf` snippet to `cafe`
4145
- `caf` for implicit return
4246
- `cafe` for explicit return
4347

44-
## [2.2.1] - 2022/05/03
48+
## 2.2.1 - 2022/05/03
4549

4650
### Fixed
4751

4852
- promise readme
4953

50-
## [2.2.0] - 2022/05/02
54+
## 2.2.0 - 2022/05/02
5155

5256
### Added
5357

5458
- `afpr` snippet for promise with then, catch and finally
5559

56-
## [2.1.3] - 2022/04/21
60+
## 2.1.3 - 2022/04/21
5761

5862
### Changed
5963

6064
- internal reorganization for promises snippets
6165
- array order prop names
6266

63-
## [2.1.2] - 2022/04/21
67+
## 2.1.2 - 2022/04/21
6468

6569
### Fixed
6670

6771
- preview image
6872

69-
## [2.1.1] - 2022/04/20
73+
## 2.1.1 - 2022/04/20
7074

7175
### Removed
7276

7377
- variables, json and object literal snippets were moved to a new extension [Const & Props Snippets](https://marketplace.visualstudio.com/items?itemName=deinsoftware).
7478

75-
## [2.1.0] - 2022/04/20
79+
## 2.1.0 - 2022/04/20
7680

7781
### Added
7882

7983
- `afeea` snippet for explicit empty with arguments
8084

81-
## [2.0.1] - 2022/04/20
85+
## 2.0.1 - 2022/04/20
8286

8387
### Removed
8488

8589
- destructuring snippets were moved to a new extension [Const & Props Snippets](https://marketplace.visualstudio.com/items?itemName=deinsoftware).
8690

87-
## [2.0.0] - 2022/04/20
91+
## 2.0.0 - 2022/04/20
8892

8993
### Removed
9094

9195
- all the const and properties snippets were moved to a new extension [Const & Props Snippets](https://marketplace.visualstudio.com/items?itemName=deinsoftware.const-props-snippets)
9296
- array snippets not related with arrow functions
9397

94-
## [1.11.0] - 2022/04/17
98+
## 1.11.0 - 2022/04/17
9599

96100
### Added
97101

98102
- new export function section snippets
99103

100-
## [1.10.0] - 2022/04/01
104+
## 1.10.0 - 2022/04/01
101105

102106
### Added
103107

104108
- `caaf` snippet for constant async arrow function
105109
- `caaft` snippet for constant async arrow function with explicit type
106110

107-
## [1.9.0] - 2022/03/08
111+
## 1.9.0 - 2022/03/08
108112

109113
### Added
110114

111115
- `caf` snippet for constant arrow function
112116
- `caft` snippet for constant arrow function with explicit type
113117

114-
## [1.8.0] - 2022/02/03
118+
## 1.8.0 - 2022/02/03
115119

116120
### Added
117121

118122
- `afee` snippet for arrow function explicit without `return`
119123

120-
## [1.7.2] - 2022/01/26
124+
## 1.7.2 - 2022/01/26
121125

122126
### Fixed
123127

124128
- Snippet are not working on TSX attributes
125129

126-
## [1.7.1] - 2022/01/26
130+
## 1.7.1 - 2022/01/26
127131

128132
### Fixed
129133

130134
- Snippet are not working on JSX attributes
131135

132-
## [1.7.0] - 2022/01/13
136+
## 1.7.0 - 2022/01/13
133137

134138
### Added
135139

136140
- Array Unique Values snippet
137141

138-
## [1.6.1] - 2021/12/27
142+
## 1.6.1 - 2021/12/27
139143

140144
### Fixed
141145

142146
- README menu link to Arrays
143147

144-
## [1.6.0] - 2021/12/27
148+
## 1.6.0 - 2021/12/27
145149

146150
### Added
147151

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -111,26 +111,24 @@ Below is a list of all available snippets and the triggers of each one. The **
111111
| `afe→` | explicit return | <code>() => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
112112
| `afea→` | explicit return with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
113113
| `afead→` | explicit return with arg destructuring | <code>({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
114-
| `afee→` | explicit empty | <code>() => {<br/>&nbsp;&nbsp;█<br/> }</code> |
115-
| `afeea→` | explicit empty with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
116114
| `afp→` | explicit with parentheses | <code>() => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
117115
| `afpa→` | explicit with parentheses and arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
116+
| `afii→` | immediately invoque | `(() => █)()` |
118117
| `iiaf→` | immediately invoque | `(() => █)()` |
119118

120119
#### Async Arrow Functions
121120

122121
| Trigger | Description | Result JS/TS |
123122
| -------: | -------------------------------------- | ---------------------------------------------------------------- |
124-
| `aaf→` | async implicit return without arg(s) | `async () => █` |
125-
| `aafa→` | async implicit return with arg(s) | `async (arg) => █` |
126-
| `aafad→` | async implicit with arg destructuring | `async ({ prop }) => █` |
127-
| `aafe→` | async explicit empty | <code>async () => {<br/>&nbsp;&nbsp;█<br/> }</code> |
128-
| `aafea→` | async explicit empty with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
129-
| `aafer→` | async explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
130-
|`aafera→` | async explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
131-
|`aafead→` | explicit return with arg destructuring | <code>async ({prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
132-
|`aaafea→` | async explicit empty with args & await | <code>async (arg) => {<br/>&nbsp;&nbsp;const █ = await █<br/> }</code>|
133-
| `aafii→` | async immediately invoked | `(async () => █)()` |
123+
| `aaf→` | implicit return without arg(s) | `async () => █` |
124+
| `aafa→` | implicit return with arg(s) | `async (arg) => █` |
125+
| `aafad→` | implicit with arg destructuring | `async ({ prop }) => █` |
126+
| `aafe→` | explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
127+
| `aafea→` | explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
128+
|`aafead→` | explicit return with arg destructuring | <code>async ({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
129+
|`aaafea→` | explicit with args and await | <code>async (arg) => {<br/>&nbsp;&nbsp;const name = await █<br/> }</code>|
130+
| `aafii→` | immediately invoked | `(async () => █)()` |
131+
| `iiaaf→` | immediately invoked | `(async () => █)()` |
134132

135133
### Promises
136134

package-lock.json

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "arrow-function-snippets",
33
"description": "VS Code Arrow function snippets for JS and TS",
4-
"version": "2.5.2",
4+
"version": "3.0.0",
55
"displayName": "Arrow Function Snippets",
66
"publisher": "deinsoftware",
77
"icon": "images/light-icon.png",

snippets/arrow.json

Lines changed: 13 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,19 @@
2626
},
2727
"arrowFunctionExplicit": {
2828
"prefix": "afe",
29-
"body": ["() => {", "\treturn $0", "}"],
29+
"body": ["() => {", "\t${1:return} $0", "}"],
3030
"description": "Arrow function (explicit return)"
3131
},
3232
"arrowFunctionExplicitWithArguments": {
3333
"prefix": "afea",
34-
"body": ["(${1:arg}) => {", "\treturn ${0}", "}"],
34+
"body": ["(${1:arg}) => {", "\t${2:return} $0", "}"],
3535
"description": "Arrow function (explicit return) with arguments"
3636
},
3737
"arrowFunctionExplicitWithArgumentDestructuring": {
3838
"prefix": "afead",
39-
"body": ["({${1:prop}, ${2:prop}}) => {", "\treturn ${0}", "}"],
39+
"body": ["({${1:prop}, ${2:prop}}) => {", "\t${3:return} $0", "}"],
4040
"description": "Arrow function (explicit return) with argument destructuring"
4141
},
42-
"arrowFunctionExplicitEmpty": {
43-
"prefix": "afee",
44-
"body": ["() => {", "\t$0", "}"],
45-
"description": "Arrow function (without return)"
46-
},
47-
"arrowFunctionExplicitEmptyWithArguments": {
48-
"prefix": "afeea",
49-
"body": ["(${1:arg}) => {", "\t$0", "}"],
50-
"description": "Arrow function (without return) with arguments"
51-
},
5242
"arrowFunctionParentheses": {
5343
"prefix": "afp",
5444
"body": ["() => {", "\t( ${0} )", "}"],
@@ -77,41 +67,31 @@
7767
"arrowAsyncFunctionImplicitWithArgumentDestructuring": {
7868
"prefix": "aafad",
7969
"body": "async ({ ${1:prop} }) => $0",
80-
"description": "Arrow function (explicit return) with argument destructuring"
70+
"description": "Arrow async function (explicit return) with argument destructuring"
8171
},
82-
"arrowAsyncFunctionExplicitEmpty": {
72+
"arrowAsyncFunctionExplicitReturn": {
8373
"prefix": "aafe",
84-
"body": ["async () => {", "\t$0", "}"],
85-
"description": "Arrow async function (explicit without return)"
74+
"body": ["async () => {", "\t${1:return} $0", "}"],
75+
"description": "Arrow async function (explicit with return)"
8676
},
87-
"arrowAsyncFunctionExplicitEmptyWithArguments": {
77+
"arrowAsyncFunctionExplicitWithArguments": {
8878
"prefix": "aafea",
89-
"body": ["async (${1:arg}) => {", "\t$0", "}"],
79+
"body": ["async (${1:arg}) => {", "\t${2:return} $0", "}"],
9080
"description": "Arrow async function (explicit without return) with arguments"
9181
},
92-
"arrowAsyncFunctionExplicitReturn": {
93-
"prefix": "aafer",
94-
"body": ["async () => {", "\treturn ${0}", "}"],
95-
"description": "Arrow async function (explicit with return)"
96-
},
97-
"arrowAsyncFunctionExplicitReturnWithArguments": {
98-
"prefix": "aafera",
99-
"body": ["async (${1:arg}) => {", "\treturn ${0}", "}"],
100-
"description": "Arrow async function (explicit with return) with arguments"
101-
},
10282
"arrowAsyncFunctionExplicitWithArgumentDestructuring": {
10383
"prefix": "aafead",
104-
"body": ["async ({ ${1:prop} }) => {", "\treturn ${0}", "}"],
84+
"body": ["async ({ ${1:prop}, ${2:prop} }) => {", "\t${3:return} $0", "}"],
10585
"description": "Arrow async function (explicit return) with argument destructuring"
10686
},
10787
"arrowAsyncAwaitFunctionExplicitWithArguments": {
10888
"prefix": "aaafea",
109-
"body": ["async (${1:arg}) => {", "\tconst ${2} = await ${0}", "}"],
110-
"description": "Arrow async-await function (explicit with return) with arguments"
89+
"body": ["async (${1:arg}) => {", "\tconst ${2:name} = await ${0}", "}"],
90+
"description": "Arrow async-await function (explicit without return) with arguments"
11191
},
11292
"arrowAsyncFunctionImmediatelyInvoque": {
11393
"prefix": ["iiaaf", "aafii"],
11494
"body": "(async () => $0)()",
115-
"description": "Arrow Async function Immediately Invoke"
95+
"description": "Arrow async function Immediately Invoke"
11696
}
11797
}

0 commit comments

Comments
 (0)