Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
- // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
- // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
- // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
- // Placeholders with the same ids are connected.
- // Example:
- "Print to console0": {
- "scope": "javascript,typescript",
- "prefix": "log",
- "body": [
- "console.log($1);",
- "$2"
- ],
- "description": "Log output to console"
- },
- "Print to console1": {
- "scope": "javascript,typescript",
- "prefix": "cl",
- "body": [
- "console.log($1);",
- "$2"
- ],
- "description": "Log output to console"
- },
- "Print to console2": {
- "scope": "javascript,typescript",
- "prefix": "c",
- "body": [
- "console.log($1);",
- "$2"
- ],
- "description": "Log output to console"
- },
- "Print to console3": {
- "scope": "javascript,typescript",
- "prefix": "con",
- "body": [
- "console.log($1);",
- "$2"
- ],
- "description": "Log output to console"
- },
- "set state": {
- "scope": "javascript,typescript",
- "prefix": "sets",
- "body": [
- "const [$1,use$1] = useState($2);",
- "$3"
- ],
- "description": "react set state"
- },
- "import react": {
- "scope": "javascript,typescript",
- "prefix": "imp",
- "body": "import React, {useState,useEffects} from \"react\";",
- "description": "react set state"
- },
- "export default function": {
- "scope": "javascript,typescript",
- "prefix": "exp",
- "body": [
- "export default function $1($2) {",
- "$3",
- "}"
- ],
- "description": "react set state"
- },
- "JSON Stringify": {
- "scope": "javascript,typescript",
- "prefix": "str",
- "body": "JSON.stringify($1)",
- "description": "json stringify"
- },
- "JSON Stringify console log": {
- "scope": "javascript,typescript",
- "prefix": "cj",
- "body": [
- "console.log(JSON.stringify($1));",
- ],
- "description": "json stringify Log output to console"
- },
- "ternary if": {
- "scope": "javascript,typescript",
- "prefix": "ter",
- "body": "$1 ? $2 : $3;",
- "description": "ternary if js"
- },
- "map func": {
- "scope": "javascript,typescript",
- "prefix": "mp",
- "body": [
- "map( $1 => {",
- "\tx$2",
- "return $3",
- "})",
- "$4"
- ],
- "description": "map js func"
- },
- "if": {
- "scope": "javascript,typescript",
- "prefix": "iff",
- "body": [
- "if($1) {",
- "\t$2",
- "}",
- "$3"
- ],
- "description": "if"
- },
- "else if": {
- "scope": "javascript,typescript",
- "prefix": "elif",
- "body": [
- "else if($1) {",
- "\t$2",
- "}",
- "$3"
- ],
- "description": "elseif"
- },
- "Array Method": {
- "prefix": "arrmth",
- "body": [
- "${1|forEach,map,filter,reduce,some|}((${2:item}) => {",
- " $3",
- "})"
- ],
- "description": "Array Method"
- },
- "Function": {
- "scope": "javascript,typescript",
- "prefix": "func",
- "body": [
- "const $1 = ($2) => {",
- "\t$3",
- "\treturn $4",
- "};",
- "$5"
- ],
- "description": "const fat arrow function"
- },
- "(ES6) Arrow function": {
- "prefix": "fat",
- "body": [
- "($1) => {",
- "\t$0",
- "}"
- ],
- "description": "ES6 import syntax"
- },
- "(ES8) Async function 1": {
- "prefix": "async",
- "body": [
- "async function ${1:name} ($2) {",
- "\t${4:await ${3:new Promise((resolve) => resolve())}}$0",
- "}"
- ],
- "description": "ES6 import syntax"
- },
- "for...in": {
- "prefix": "for in",
- "body": [
- "for (const ${1:property} in ${2:obj}) {",
- "\t$0",
- "}"
- ],
- "description": "for...in syntax"
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement