From 5218470f13d3202bf91354224fe0760d5c069842 Mon Sep 17 00:00:00 2001 From: Pramod Kandel Date: Mon, 22 Mar 2021 03:06:52 -0700 Subject: [PATCH] Added snippet for async named function. --- README.md | 1 + snippets/snippets.json | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 499e2ca..70f281f 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ Below is a list of all available snippets and the triggers of each one. The ** | `fin→` | for ... in loop `for(const item in object) {}` | | `anfn→` | creates an anonymous function `(params) => {}` | | `nfn→` | creates a named function `const add = (params) => {}` | +| `asnfn→` | creates an async named function `const add = async (params) => {}` | | `dob→` | destructing object syntax `const {rename} = fs` | | `dar→` | destructing array syntax `const [first, second] = [1,2]` | | `sti→` | set interval helper method `setInterval(() => {});` | diff --git a/snippets/snippets.json b/snippets/snippets.json index 74dee93..4779112 100644 --- a/snippets/snippets.json +++ b/snippets/snippets.json @@ -111,6 +111,11 @@ "body": "const ${1:name} = (${2:params}) => {\n\t${3}\n}", "description": "Creates a named function in ES6 syntax" }, + "asyncNamedFunction": { + "prefix": "asnfn", + "body": "const ${1:name} = async (${2:params}) => {\n\t${3}\n}", + "description": "Creates an async named function in ES6 syntax" + }, "destructingObject": { "prefix": "dob", "body": "const {${2:propertyName}} = ${1:objectToDestruct};",