From b593603765c93226c03522167d0478142e63b28d Mon Sep 17 00:00:00 2001 From: Alex Antonov Date: Fri, 2 Jun 2017 10:21:37 +0300 Subject: [PATCH] Destructuring assignment --- README.md | 10 ++++++++++ snippets/declarations.cson | 6 ++++++ 2 files changed, 16 insertions(+) diff --git a/README.md b/README.md index 497cab4..b40c30d 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,11 @@ let ${1:name} let ${1:name} = ${2:value} ``` +#### `l={⇥` destructuring let assignment +```js +let { ${1: name} } = ${2:value} +``` + #### `co⇥` const statement ```js const ${1:name} @@ -55,6 +60,11 @@ const ${1:name} const ${1:name} = ${2:value} ``` +#### `co={⇥` destructuring const assignment +```js +const { ${1:name} } = ${2:value} +``` + ### Flow Control #### `if⇥` if statement diff --git a/snippets/declarations.cson b/snippets/declarations.cson index 82b672b..47bcbd5 100644 --- a/snippets/declarations.cson +++ b/snippets/declarations.cson @@ -11,9 +11,15 @@ "let assignment": prefix: "l=" body: "let ${1:name} = ${2:value}" + "destructuring let assignment": + prefix: "l={" + body: "let { ${1: name} } = ${2:value}" "const statement": prefix: "co" body: "const ${1:name}" "const assignment": prefix: "co=" body: "const ${1:name} = ${2:value}" + "destructuring const assignment": + prefix: "co={" + body: "const { ${1:name} } = ${2:value}"