Skip to content

Commit

Permalink
Merge pull request #6 from deinsoftware/dev
Browse files Browse the repository at this point in the history
change async arrow functions
  • Loading branch information
equiman authored Oct 19, 2022
2 parents 6802295 + 8ae4722 commit 6525feb
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 83 deletions.
24 changes: 11 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
{
"cSpell.words": [
"aaafea",
"aaf",
"aafa",
"aafad",
"aafe",
"aafea",
"aafead",
"aafii",
"afad",
"afeea",
"afer",
Expand All @@ -11,16 +19,6 @@
"afpr",
"afrd",
"afrj",
"aaf",
"aafa",
"aafad",
"aafe",
"aafea",
"aafer",
"aafera",
"aafead",
"aaafea",
"aafii",
"arfeq",
"arfne",
"arfoeq",
Expand All @@ -29,7 +27,6 @@
"arsna",
"arsnd",
"aruv",
"buymeacoffee",
"caaf",
"caaft",
"caft",
Expand All @@ -42,10 +39,11 @@
"edaf",
"Eomm",
"Equiman",
"iiaf",
"iiaaf",
"patreon",
"iiaf",
"kural",
"paypal",
"pranav",
"volta",
"vuejs"
],
Expand Down
52 changes: 28 additions & 24 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,139 +9,143 @@ Fixed for any bug fixes.
Security to invite users to upgrade in case of vulnerabilities.
-->

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

### Fixed
### Removed

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

### Added

- Add sibling extension to README
- Async-await arrow functions, by @pranav-kural

## [2.5.1] - 2022/06/23
## 2.5.1 - 2022/06/23

### Fixed

- Support property on README

## [2.5.0] - 2022/06/23
## 2.5.0 - 2022/06/23

### Added

- Support property

## [2.4.0] - 2022/05/19
## 2.4.0 - 2022/05/19

### Changed

- unifying image

## [2.3.0] - 2022/05/05
## 2.3.0 - 2022/05/05

### Changed

- `caf` snippet to `cafe`
- `caf` for implicit return
- `cafe` for explicit return

## [2.2.1] - 2022/05/03
## 2.2.1 - 2022/05/03

### Fixed

- promise readme

## [2.2.0] - 2022/05/02
## 2.2.0 - 2022/05/02

### Added

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

## [2.1.3] - 2022/04/21
## 2.1.3 - 2022/04/21

### Changed

- internal reorganization for promises snippets
- array order prop names

## [2.1.2] - 2022/04/21
## 2.1.2 - 2022/04/21

### Fixed

- preview image

## [2.1.1] - 2022/04/20
## 2.1.1 - 2022/04/20

### Removed

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

## [2.1.0] - 2022/04/20
## 2.1.0 - 2022/04/20

### Added

- `afeea` snippet for explicit empty with arguments

## [2.0.1] - 2022/04/20
## 2.0.1 - 2022/04/20

### Removed

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

## [2.0.0] - 2022/04/20
## 2.0.0 - 2022/04/20

### Removed

- 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)
- array snippets not related with arrow functions

## [1.11.0] - 2022/04/17
## 1.11.0 - 2022/04/17

### Added

- new export function section snippets

## [1.10.0] - 2022/04/01
## 1.10.0 - 2022/04/01

### Added

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

## [1.9.0] - 2022/03/08
## 1.9.0 - 2022/03/08

### Added

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

## [1.8.0] - 2022/02/03
## 1.8.0 - 2022/02/03

### Added

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

## [1.7.2] - 2022/01/26
## 1.7.2 - 2022/01/26

### Fixed

- Snippet are not working on TSX attributes

## [1.7.1] - 2022/01/26
## 1.7.1 - 2022/01/26

### Fixed

- Snippet are not working on JSX attributes

## [1.7.0] - 2022/01/13
## 1.7.0 - 2022/01/13

### Added

- Array Unique Values snippet

## [1.6.1] - 2021/12/27
## 1.6.1 - 2021/12/27

### Fixed

- README menu link to Arrays

## [1.6.0] - 2021/12/27
## 1.6.0 - 2021/12/27

### Added

Expand Down
22 changes: 10 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,26 +111,24 @@ Below is a list of all available snippets and the triggers of each one. The **
| `afe→` | explicit return | <code>() => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afea→` | explicit return with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afead→` | explicit return with arg destructuring | <code>({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `afee→` | explicit empty | <code>() => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `afeea→` | explicit empty with arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `afp→` | explicit with parentheses | <code>() => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
| `afpa→` | explicit with parentheses and arg(s) | <code>(arg) => {<br/>&nbsp;&nbsp;(█)<br/> }</code> |
| `afii→` | immediately invoque | `(() => █)()` |
| `iiaf→` | immediately invoque | `(() => █)()` |

#### Async Arrow Functions

| Trigger | Description | Result JS/TS |
| -------: | -------------------------------------- | ---------------------------------------------------------------- |
| `aaf→` | async implicit return without arg(s) | `async () => █` |
| `aafa→` | async implicit return with arg(s) | `async (arg) => █` |
| `aafad→` | async implicit with arg destructuring | `async ({ prop }) => █` |
| `aafe→` | async explicit empty | <code>async () => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `aafea→` | async explicit empty with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;█<br/> }</code> |
| `aafer→` | async explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aafera→` | async explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aafead→` | explicit return with arg destructuring | <code>async ({prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aaafea→` | async explicit empty with args & await | <code>async (arg) => {<br/>&nbsp;&nbsp;const █ = await █<br/> }</code>|
| `aafii→` | async immediately invoked | `(async () => █)()` |
| `aaf→` | implicit return without arg(s) | `async () => █` |
| `aafa→` | implicit return with arg(s) | `async (arg) => █` |
| `aafad→` | implicit with arg destructuring | `async ({ prop }) => █` |
| `aafe→` | explicit return | <code>async () => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
| `aafea→` | explicit return with arg(s) | <code>async (arg) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aafead→` | explicit return with arg destructuring | <code>async ({prop, prop}) => {<br/>&nbsp;&nbsp;return █<br/> }</code> |
|`aaafea→` | explicit with args and await | <code>async (arg) => {<br/>&nbsp;&nbsp;const name = await █<br/> }</code>|
| `aafii→` | immediately invoked | `(async () => █)()` |
| `iiaaf→` | immediately invoked | `(async () => █)()` |

### Promises

Expand Down
16 changes: 16 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "arrow-function-snippets",
"description": "VS Code Arrow function snippets for JS and TS",
"version": "2.5.2",
"version": "3.0.0",
"displayName": "Arrow Function Snippets",
"publisher": "deinsoftware",
"icon": "images/light-icon.png",
Expand Down
46 changes: 13 additions & 33 deletions snippets/arrow.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,29 +26,19 @@
},
"arrowFunctionExplicit": {
"prefix": "afe",
"body": ["() => {", "\treturn $0", "}"],
"body": ["() => {", "\t${1:return} $0", "}"],
"description": "Arrow function (explicit return)"
},
"arrowFunctionExplicitWithArguments": {
"prefix": "afea",
"body": ["(${1:arg}) => {", "\treturn ${0}", "}"],
"body": ["(${1:arg}) => {", "\t${2:return} $0", "}"],
"description": "Arrow function (explicit return) with arguments"
},
"arrowFunctionExplicitWithArgumentDestructuring": {
"prefix": "afead",
"body": ["({${1:prop}, ${2:prop}}) => {", "\treturn ${0}", "}"],
"body": ["({${1:prop}, ${2:prop}}) => {", "\t${3:return} $0", "}"],
"description": "Arrow function (explicit return) with argument destructuring"
},
"arrowFunctionExplicitEmpty": {
"prefix": "afee",
"body": ["() => {", "\t$0", "}"],
"description": "Arrow function (without return)"
},
"arrowFunctionExplicitEmptyWithArguments": {
"prefix": "afeea",
"body": ["(${1:arg}) => {", "\t$0", "}"],
"description": "Arrow function (without return) with arguments"
},
"arrowFunctionParentheses": {
"prefix": "afp",
"body": ["() => {", "\t( ${0} )", "}"],
Expand Down Expand Up @@ -77,41 +67,31 @@
"arrowAsyncFunctionImplicitWithArgumentDestructuring": {
"prefix": "aafad",
"body": "async ({ ${1:prop} }) => $0",
"description": "Arrow function (explicit return) with argument destructuring"
"description": "Arrow async function (explicit return) with argument destructuring"
},
"arrowAsyncFunctionExplicitEmpty": {
"arrowAsyncFunctionExplicitReturn": {
"prefix": "aafe",
"body": ["async () => {", "\t$0", "}"],
"description": "Arrow async function (explicit without return)"
"body": ["async () => {", "\t${1:return} $0", "}"],
"description": "Arrow async function (explicit with return)"
},
"arrowAsyncFunctionExplicitEmptyWithArguments": {
"arrowAsyncFunctionExplicitWithArguments": {
"prefix": "aafea",
"body": ["async (${1:arg}) => {", "\t$0", "}"],
"body": ["async (${1:arg}) => {", "\t${2:return} $0", "}"],
"description": "Arrow async function (explicit without return) with arguments"
},
"arrowAsyncFunctionExplicitReturn": {
"prefix": "aafer",
"body": ["async () => {", "\treturn ${0}", "}"],
"description": "Arrow async function (explicit with return)"
},
"arrowAsyncFunctionExplicitReturnWithArguments": {
"prefix": "aafera",
"body": ["async (${1:arg}) => {", "\treturn ${0}", "}"],
"description": "Arrow async function (explicit with return) with arguments"
},
"arrowAsyncFunctionExplicitWithArgumentDestructuring": {
"prefix": "aafead",
"body": ["async ({ ${1:prop} }) => {", "\treturn ${0}", "}"],
"body": ["async ({ ${1:prop}, ${2:prop} }) => {", "\t${3:return} $0", "}"],
"description": "Arrow async function (explicit return) with argument destructuring"
},
"arrowAsyncAwaitFunctionExplicitWithArguments": {
"prefix": "aaafea",
"body": ["async (${1:arg}) => {", "\tconst ${2} = await ${0}", "}"],
"description": "Arrow async-await function (explicit with return) with arguments"
"body": ["async (${1:arg}) => {", "\tconst ${2:name} = await ${0}", "}"],
"description": "Arrow async-await function (explicit without return) with arguments"
},
"arrowAsyncFunctionImmediatelyInvoque": {
"prefix": ["iiaaf", "aafii"],
"body": "(async () => $0)()",
"description": "Arrow Async function Immediately Invoke"
"description": "Arrow async function Immediately Invoke"
}
}

0 comments on commit 6525feb

Please sign in to comment.