ItsMeStevieG

snippets.json

Feb 23rd, 2021 (edited)
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 51.71 KB | None | 0 0
  1. {
  2.   "import": {
  3.     "prefix": "imp",
  4.     "body": "import ${2:moduleName} from '${1:module}'$0"
  5.   },
  6.   "importNoModuleName": {
  7.     "prefix": "imn",
  8.     "body": "import '${1:module}'$0"
  9.   },
  10.   "importDestructing": {
  11.     "prefix": "imd",
  12.     "body": "import { $2 } from '${1:module}'$0"
  13.   },
  14.   "importEverything": {
  15.     "prefix": "ime",
  16.     "body": "import * as ${2:alias} from '${1:module}'$0"
  17.   },
  18.   "importAs": {
  19.     "prefix": "ima",
  20.     "body": "import { ${2:originalName} as ${3:alias} } from '${1:module}'$0"
  21.   },
  22.   "exportDefault": {
  23.     "prefix": "exp",
  24.     "body": "export default $1$0"
  25.   },
  26.   "exportDestructing": {
  27.     "prefix": "exd",
  28.     "body": "export { $2 } from '${1:module}'$0"
  29.   },
  30.   "exportAs": {
  31.     "prefix": "exa",
  32.     "body": "export { ${2:originalName} as ${3:alias} } from '${1:module}'$0"
  33.   },
  34.   "exportNamedFunction": {
  35.     "prefix": "enf",
  36.     "body": [
  37.       "export const ${1:functionName} = (${2:params}) => {",
  38.       "\t$0",
  39.       "}",
  40.       ""
  41.     ],
  42.     "description": "Export named function in ES7 syntax"
  43.   },
  44.   "exportDefaultFunction": {
  45.     "prefix": "edf",
  46.     "body": ["export default (${1:params}) => {", "\t$0", "}", ""],
  47.     "description": "Export default function in ES7 syntax"
  48.   },
  49.   "method": {
  50.     "prefix": "met",
  51.     "body": ["${1:methodName} = (${2:params}) => {", "\t${0}", "}", ""],
  52.     "description": "Creates a method inside a class in ES7 syntax"
  53.   },
  54.   "propertyGet": {
  55.     "prefix": "pge",
  56.     "body": ["get ${1:propertyName}() {", "\treturn this.${0}", "}", ""],
  57.     "description": "Creates a getter property inside a class in ES7 syntax"
  58.   },
  59.   "propertySet": {
  60.     "prefix": "pse",
  61.     "body": ["set ${1:propertyName}(${2:value}) {", "\t${0}", "}", ""],
  62.     "description": "Creates a setter property inside a class in ES7 syntax"
  63.   },
  64.   "forEach": {
  65.     "prefix": "fre",
  66.     "body": ["${1:array}.forEach(${2:currentItem} => {", "\t${0}", "})", ""],
  67.     "description": "Creates a forEach statement in ES7 syntax"
  68.   },
  69.   "forOf": {
  70.     "prefix": "fof",
  71.     "body": ["for(let ${1:item} of ${2:object}) {", "\t${0}", "}", ""],
  72.     "description": "Iterating over property names of iterable objects"
  73.   },
  74.   "forIn": {
  75.     "prefix": "fin",
  76.     "body": ["for(let ${1:item} in ${2:object}) {", "\t${0}", "}", ""],
  77.     "description": "Iterating over property values of iterable objects"
  78.   },
  79.   "anonymousFunction": {
  80.     "prefix": "anfn",
  81.     "body": ["(${1:params}) => {", "\t${2}", "}"],
  82.     "description": "Creates an anonymous function in ES7 syntax"
  83.   },
  84.   "namedFunction": {
  85.     "prefix": "nfn",
  86.     "body": ["const ${1:name} = (${2:params}) => {", "\t${3}", "}", ""],
  87.     "description": "Creates a named function in ES7 syntax"
  88.   },
  89.   "destructingObject": {
  90.     "prefix": "dob",
  91.     "body": "const {${1:propertyName}} = ${2:objectToDestruct}",
  92.     "description": "Creates and assigns a local variable using object destructing"
  93.   },
  94.   "destructingArray": {
  95.     "prefix": "dar",
  96.     "body": "const [${1:propertyName}] = ${2:arrayToDestruct}",
  97.     "description": "Creates and assigns a local variable using array destructing"
  98.   },
  99.   "setInterval": {
  100.     "prefix": "sti",
  101.     "body": ["setInterval(() => {", "\t${2}", "}, ${0:intervalInms})", ""],
  102.     "description": "Executes the given function at specified intervals in ES7 syntax"
  103.   },
  104.   "setTimeOut": {
  105.     "prefix": "sto",
  106.     "body": ["setTimeout(() => {", "\t${2}", "}, ${1:delayInms})", ""],
  107.     "description": "Executes the given function after the specified delay in ES7 syntax"
  108.   },
  109.   "promise": {
  110.     "prefix": "prom",
  111.     "body": ["return new Promise((resolve, reject) => {", "\t${1}", "})", ""],
  112.     "description": "Creates and returns a new Promise in the standard ES7 syntax"
  113.   },
  114.   "consoleAssert": {
  115.     "prefix": "cas",
  116.     "body": "console.assert(${1:expression}, ${2:object})",
  117.     "description": "If the specified expression is false, the message is written to the console along with a stack trace"
  118.   },
  119.   "consoleClear": {
  120.     "prefix": "ccl",
  121.     "body": "console.clear()",
  122.     "description": "Clears the console"
  123.   },
  124.   "consoleCount": {
  125.     "prefix": "cco",
  126.     "body": "console.count(${1:label})",
  127.     "description": "Writes the the number of times that count() has been invoked at the same line and with the same label"
  128.   },
  129.   "consoleDir": {
  130.     "prefix": "cdi",
  131.     "body": "console.dir(${1:object})",
  132.     "description": "Prints a JavaScript representation of the specified object"
  133.   },
  134.   "consoleError": {
  135.     "prefix": "cer",
  136.     "body": "console.error(${1:object})",
  137.     "description": "Displays a message in the console and also includes a stack trace from where the method was called"
  138.   },
  139.   "consoleGroup": {
  140.     "prefix": "cgr",
  141.     "body": "console.group(\"${1:label}\")",
  142.     "description": "Groups and indents all following output by an additional level, until console.groupEnd() is called."
  143.   },
  144.   "consoleGroupEnd": {
  145.     "prefix": "cge",
  146.     "body": "console.groupEnd()",
  147.     "description": "Closes out the corresponding console.group()."
  148.   },
  149.   "consoleLog": {
  150.     "prefix": "clg",
  151.     "body": "console.log(${1:object})",
  152.     "description": "Displays a message in the console"
  153.   },
  154.   "consoleTrace": {
  155.     "prefix": "ctr",
  156.     "body": "console.trace(${1:object})",
  157.     "description": "Prints a stack trace from the point where the method was called"
  158.   },
  159.   "consoleLogObject": {
  160.     "prefix": "clo",
  161.     "body": "console.log('${1:object}', ${1:object})",
  162.     "description": "Logs property with name."
  163.   },
  164.   "consoleTime": {
  165.     "prefix": "ctm",
  166.     "body": "console.time('${1:object}')",
  167.     "description": "Console time wrapper"
  168.   },
  169.   "consoleTimeEnd": {
  170.     "prefix": "cte",
  171.     "body": "console.timeEnd('${1:object}')",
  172.     "description": "Console time end wrapper"
  173.   },
  174.   "consoleWarn": {
  175.     "prefix": "cwa",
  176.     "body": "console.warn(${1:object})",
  177.     "description": "Displays a message in the console but also displays a yellow warning icon along with the logged message"
  178.   },
  179.   "consoleInfo": {
  180.     "prefix": "cin",
  181.     "body": "console.info(${1:object})",
  182.     "description": "Displays a message in the console but also displays a blue information icon along with the logged message"
  183.   },
  184.   "destructProps": {
  185.     "prefix": "cp",
  186.     "body": ["const { $1 } = this.props"],
  187.     "description": "Creates and assigns a local variable using props destructing"
  188.   },
  189.   "destructState": {
  190.     "prefix": "cs",
  191.     "body": ["const { $1 } = this.state"],
  192.     "description": "Creates and assigns a local variable using state destructing"
  193.   },
  194.   "import React": {
  195.     "prefix": "imr",
  196.     "body": ["import React from 'react'", ""]
  197.   },
  198.   "import ReactDOM": {
  199.     "prefix": "imrd",
  200.     "body": ["import ReactDOM from 'react-dom'", ""]
  201.   },
  202.   "import React, { Component }": {
  203.     "prefix": "imrc",
  204.     "body": ["import React, { Component } from 'react'", ""]
  205.   },
  206.   "import React, { Component } & PropTypes": {
  207.     "prefix": "imrcp",
  208.     "body": [
  209.       "import React, { Component } from 'react'",
  210.       "import PropTypes from 'prop-types'",
  211.       ""
  212.     ]
  213.   },
  214.   "import React, { PureComponent }": {
  215.     "prefix": "imrpc",
  216.     "body": ["import React, { PureComponent } from 'react'", ""]
  217.   },
  218.   "import React, { PureComponent } & PropTypes": {
  219.     "prefix": "imrpcp",
  220.     "body": [
  221.       "import React, { PureComponent } from 'react'",
  222.       "import PropTypes from 'prop-types'",
  223.       ""
  224.     ]
  225.   },
  226.   "import React, { memo }": {
  227.     "prefix": "imrm",
  228.     "body": ["import React, { memo } from 'react'", ""]
  229.   },
  230.   "import React, { memo } & PropTypes": {
  231.     "prefix": "imrmp",
  232.     "body": [
  233.       "import React, { memo } from 'react'",
  234.       "import PropTypes from 'prop-types'",
  235.       ""
  236.     ]
  237.   },
  238.   "import React, {useState}": {
  239.     "prefix": "imrs",
  240.     "body": ["import React, { useState } from 'react'", ""]
  241.   },
  242.   "import React, {useState, useEffect}": {
  243.     "prefix": "imrse",
  244.     "body": ["import React, { useState, useEffect } from 'react'", ""]
  245.   },
  246.   "import PropTypes": {
  247.     "prefix": "impt",
  248.     "body": ["import PropTypes from 'prop-types'", ""]
  249.   },
  250.   "import React Router": {
  251.     "prefix": "imrr",
  252.     "body": [
  253.       "import { BrowserRouter as Router, Route, NavLink } from 'react-router-dom'",
  254.       ""
  255.     ]
  256.   },
  257.   "import React Browser Router": {
  258.     "prefix": "imbr",
  259.     "body": ["import { BrowserRouter as Router } from 'react-router-dom'", ""]
  260.   },
  261.   "import React Browser Router - Route": {
  262.     "prefix": "imbrr",
  263.     "body": ["import { Route } from 'react-router-dom'", ""]
  264.   },
  265.   "import React Browser Router - Route Combo": {
  266.     "prefix": "imbrc",
  267.     "body": [
  268.       "import { Route, Switch, NavLink, Link } from 'react-router-dom'",
  269.       ""
  270.     ]
  271.   },
  272.   "import React Browser Router - Switch": {
  273.     "prefix": "imbrs",
  274.     "body": ["import { Switch } from 'react-router-dom'", ""]
  275.   },
  276.   "import React Browser Router - Link": {
  277.     "prefix": "imbrl",
  278.     "body": ["import { Link } from 'react-router-dom'", ""]
  279.   },
  280.   "import React Browser Router - NavLink": {
  281.     "prefix": "imbrnl",
  282.     "body": ["import { NavLink } from 'react-router-dom'", ""]
  283.   },
  284.   "import redux statement": {
  285.     "prefix": "redux",
  286.     "body": ["import { connect } from 'react-redux'", ""]
  287.   },
  288.   "reactClassCompoment": {
  289.     "prefix": "rcc",
  290.     "body": [
  291.       "import React, { Component } from 'react'",
  292.       "",
  293.       "export default class ${1:${TM_FILENAME_BASE}} extends Component {",
  294.       "\trender() {",
  295.       "\t\treturn (",
  296.       "\t\t\t<div>",
  297.       "\t\t\t\t$0",
  298.       "\t\t\t</div>",
  299.       "\t\t)",
  300.       "\t}",
  301.       "}",
  302.       ""
  303.     ],
  304.     "description": "Creates a React component class with ES7 module system"
  305.   },
  306.   "reactClassExportComponent": {
  307.     "prefix": "rce",
  308.     "body": [
  309.       "import React, { Component } from 'react'",
  310.       "",
  311.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  312.       "\trender() {",
  313.       "\t\treturn (",
  314.       "\t\t\t<div>",
  315.       "\t\t\t\t$0",
  316.       "\t\t\t</div>",
  317.       "\t\t)",
  318.       "\t}",
  319.       "}",
  320.       "",
  321.       "export default ${1:${TM_FILENAME_BASE}}",
  322.       ""
  323.     ],
  324.     "description": "Creates a React component class with ES7 module system"
  325.   },
  326.   "reactFunctionalExportComponent": {
  327.     "prefix": "rfce",
  328.     "body": [
  329.       "import React from 'react'",
  330.       "",
  331.       "function ${1:${TM_FILENAME_BASE}}() {",
  332.       "\treturn (",
  333.       "\t\t<div>",
  334.       "\t\t\t$0",
  335.       "\t\t</div>",
  336.       "\t)",
  337.       "}",
  338.       "",
  339.       "export default ${1:${TM_FILENAME_BASE}}",
  340.       ""
  341.     ],
  342.     "description": "Creates a React Functional Component with ES7 module system"
  343.   },
  344.   "reactFunctionalComponent": {
  345.     "prefix": "rfc",
  346.     "body": [
  347.       "import React from 'react'",
  348.       "",
  349.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  350.       "\treturn (",
  351.       "\t\t<div>",
  352.       "\t\t\t$0",
  353.       "\t\t</div>",
  354.       "\t)",
  355.       "}",
  356.       ""
  357.     ],
  358.     "description": "Creates a React Functional Component with ES7 module system"
  359.   },
  360.   "reactFunctionalComponentWithPropTypes": {
  361.     "prefix": "rfcp",
  362.     "body": [
  363.       "import React from 'react'",
  364.       "import PropTypes from 'prop-types'",
  365.       "",
  366.       "function ${1:${TM_FILENAME_BASE}}(props) {",
  367.       "\treturn (",
  368.       "\t\t<div>",
  369.       "\t\t\t$0",
  370.       "\t\t</div>",
  371.       "\t)",
  372.       "}",
  373.       "",
  374.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  375.       "",
  376.       "}",
  377.       "",
  378.       "export default ${1:${TM_FILENAME_BASE}}",
  379.       "",
  380.       ""
  381.     ],
  382.     "description": "Creates a React Functional Component with ES7 module system with PropTypes"
  383.   },
  384.   "reactArrowFunctionExportComponent": {
  385.     "prefix": "rafce",
  386.     "body": [
  387.       "import React from 'react'",
  388.       "",
  389.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  390.       "\treturn (",
  391.       "\t\t<div>",
  392.       "\t\t\t$0",
  393.       "\t\t</div>",
  394.       "\t)",
  395.       "}",
  396.       "",
  397.       "export default ${1:${TM_FILENAME_BASE}}",
  398.       ""
  399.     ],
  400.     "description": "Creates a React Arrow Function Component with ES7 module system"
  401.   },
  402.   "reactArrowFunctionComponent": {
  403.     "prefix": "rafc",
  404.     "body": [
  405.       "import React from 'react'",
  406.       "",
  407.       "export const ${1:${TM_FILENAME_BASE}} = () => {",
  408.       "\treturn (",
  409.       "\t\t<div>",
  410.       "\t\t\t$0",
  411.       "\t\t</div>",
  412.       "\t)",
  413.       "}",
  414.       ""
  415.     ],
  416.     "description": "Creates a React Arrow Function Component with ES7 module system"
  417.   },
  418.   "reactArrowFunctionComponentWithPropTypes": {
  419.     "prefix": "rafcp",
  420.     "body": [
  421.       "import React from 'react'",
  422.       "import PropTypes from 'prop-types'",
  423.       "",
  424.       "const ${1:${TM_FILENAME_BASE}} = props => {",
  425.       "\treturn (",
  426.       "\t\t<div>",
  427.       "\t\t\t$0",
  428.       "\t\t</div>",
  429.       "\t)",
  430.       "}",
  431.       "",
  432.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  433.       "",
  434.       "}",
  435.       "",
  436.       "export default ${1:${TM_FILENAME_BASE}}",
  437.       ""
  438.     ],
  439.     "description": "Creates a React Arrow Function Component with ES7 module system with PropTypes"
  440.   },
  441.   "reactClassExportComponentWithPropTypes": {
  442.     "prefix": "rcep",
  443.     "body": [
  444.       "import React, { Component } from 'react'",
  445.       "import PropTypes from 'prop-types'",
  446.       "",
  447.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  448.       "\tstatic propTypes = {",
  449.       "",
  450.       "\t}",
  451.       "",
  452.       "\trender() {",
  453.       "\t\treturn (",
  454.       "\t\t\t<div>",
  455.       "\t\t\t\t$0",
  456.       "\t\t\t</div>",
  457.       "\t\t)",
  458.       "\t}",
  459.       "}",
  460.       "",
  461.       "export default ${1:${TM_FILENAME_BASE}}",
  462.       ""
  463.     ],
  464.     "description": "Creates a React component class with ES7 module system"
  465.   },
  466.   "reactClassPureComponent": {
  467.     "prefix": "rpc",
  468.     "body": [
  469.       "import React, { PureComponent } from 'react'",
  470.       "",
  471.       "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
  472.       "\trender() {",
  473.       "\t\treturn (",
  474.       "\t\t\t<div>",
  475.       "\t\t\t\t$0",
  476.       "\t\t\t</div>",
  477.       "\t\t)",
  478.       "\t}",
  479.       "}",
  480.       ""
  481.     ],
  482.     "description": "Creates a React pure component class with ES7 module system"
  483.   },
  484.   "reactClassExportPureComponent": {
  485.     "prefix": "rpce",
  486.     "body": [
  487.       "import React, { PureComponent } from 'react'",
  488.       "",
  489.       "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
  490.       "\trender() {",
  491.       "\t\treturn (",
  492.       "\t\t\t<div>",
  493.       "\t\t\t\t$0",
  494.       "\t\t\t</div>",
  495.       "\t\t)",
  496.       "\t}",
  497.       "}",
  498.       "",
  499.       "export default ${1:$TM_FILENAME_BASE}",
  500.       ""
  501.     ],
  502.     "description": "Creates a React pure component class with ES7 module system export"
  503.   },
  504.   "reactClassPureComponentWithPropTypes": {
  505.     "prefix": "rpcp",
  506.     "body": [
  507.       "import React, { PureComponent } from 'react'",
  508.       "import PropTypes from 'prop-types'",
  509.       "",
  510.       "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
  511.       "\tstatic propTypes = {",
  512.       "",
  513.       "\t}",
  514.       "",
  515.       "\trender() {",
  516.       "\t\treturn (",
  517.       "\t\t\t<div>",
  518.       "\t\t\t\t$0",
  519.       "\t\t\t</div>",
  520.       "\t\t)",
  521.       "\t}",
  522.       "}",
  523.       ""
  524.     ],
  525.     "description": "Creates a React component class with ES7 module system"
  526.   },
  527.   "reactFunctionMemoComponent": {
  528.     "prefix": "rmc",
  529.     "body": [
  530.       "import React, { memo } from 'react'",
  531.       "",
  532.       "export default memo(function ${1:${TM_FILENAME_BASE}}() {",
  533.       "\treturn (",
  534.       "\t\t<div>",
  535.       "\t\t\t$0",
  536.       "\t\t</div>",
  537.       "\t)",
  538.       "})",
  539.       ""
  540.     ],
  541.     "description": "Creates a React Memo Function Component with ES7 module system"
  542.   },
  543.   "reactFunctionMemoComponentWithPropTypes": {
  544.     "prefix": "rmcp",
  545.     "body": [
  546.       "import React, { memo } from 'react'",
  547.       "import PropTypes from 'prop-types'",
  548.       "",
  549.       "const ${1:${TM_FILENAME_BASE}} = memo(function ${1:${TM_FILENAME_BASE}}(props) {",
  550.       "\treturn (",
  551.       "\t\t<div>",
  552.       "\t\t\t$0",
  553.       "\t\t</div>",
  554.       "\t)",
  555.       "})",
  556.       "",
  557.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  558.       "",
  559.       "}",
  560.       "",
  561.       "export default ${1:${TM_FILENAME_BASE}}",
  562.       ""
  563.     ],
  564.     "description": "Creates a React Memo Function Component with ES7 module system with PropTypes"
  565.   },
  566.   "reactClassCompomentPropTypes": {
  567.     "prefix": "rccp",
  568.     "body": [
  569.       "import React, { Component } from 'react'",
  570.       "import PropTypes from 'prop-types'",
  571.       "",
  572.       "export default class ${1:${TM_FILENAME_BASE}} extends Component {",
  573.       "\tstatic propTypes = {",
  574.       "\t\t${2:prop}: ${3:PropTypes}",
  575.       "\t}",
  576.       "",
  577.       "\trender() {",
  578.       "\t\treturn (",
  579.       "\t\t\t<div>",
  580.       "\t\t\t\t$0",
  581.       "\t\t\t</div>",
  582.       "\t\t)",
  583.       "\t}",
  584.       "}",
  585.       ""
  586.     ],
  587.     "description": "Creates a React component class with PropTypes and ES7 module system"
  588.   },
  589.   "reactClassCompomentRedux": {
  590.     "prefix": "rcredux",
  591.     "body": [
  592.       "import React, { Component } from 'react'",
  593.       "import { connect } from 'react-redux'",
  594.       "",
  595.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  596.       "\trender() {",
  597.       "\t\treturn (",
  598.       "\t\t\t<div>",
  599.       "\t\t\t\t$0",
  600.       "\t\t\t</div>",
  601.       "\t\t)",
  602.       "\t}",
  603.       "}",
  604.       "",
  605.       "const mapStateToProps = (state) => ({",
  606.       "\t",
  607.       "})",
  608.       "",
  609.       "const mapDispatchToProps = {",
  610.       "\t",
  611.       "}",
  612.       "",
  613.       "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})",
  614.       ""
  615.     ],
  616.     "description": "Creates a React component class with connected redux and ES7 module system"
  617.   },
  618.   "reactClassCompomentReduxPropTypes": {
  619.     "prefix": "rcreduxp",
  620.     "body": [
  621.       "import React, { Component } from 'react'",
  622.       "import PropTypes from 'prop-types'",
  623.       "import { connect } from 'react-redux'",
  624.       "",
  625.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  626.       "\tstatic propTypes = {",
  627.       "\t\t${2:prop}: ${3:PropTypes}",
  628.       "\t}",
  629.       "",
  630.       "\trender() {",
  631.       "\t\treturn (",
  632.       "\t\t\t<div>",
  633.       "\t\t\t\t$0",
  634.       "\t\t\t</div>",
  635.       "\t\t)",
  636.       "\t}",
  637.       "}",
  638.       "",
  639.       "const mapStateToProps = (state) => ({",
  640.       "\t",
  641.       "})",
  642.       "",
  643.       "const mapDispatchToProps = {",
  644.       "\t",
  645.       "}",
  646.       "",
  647.       "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})",
  648.       ""
  649.     ],
  650.     "description": "Creates a React component class with PropTypes with connected redux and ES7 module system"
  651.   },
  652.   "reactFunctionalCompomentRedux": {
  653.     "prefix": "rfcredux",
  654.     "body": [
  655.       "import React from 'react'",
  656.       "import { connect } from 'react-redux'",
  657.       "",
  658.       "export const ${1:${TM_FILENAME_BASE}} = (props) => {",
  659.       "\treturn (",
  660.       "\t\t<div>",
  661.       "\t\t\t$0",
  662.       "\t\t</div>",
  663.       "\t)",
  664.       "}",
  665.       "",
  666.       "const mapStateToProps = (state) => ({",
  667.       "\t",
  668.       "})",
  669.       "",
  670.       "const mapDispatchToProps = {",
  671.       "\t",
  672.       "}",
  673.       "",
  674.       "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})",
  675.       ""
  676.     ],
  677.     "description": "Creates a React functional component with connected redux and ES7 module system"
  678.   },
  679.   "reactFunctionalCompomentReduxPropTypes": {
  680.     "prefix": "rfcreduxp",
  681.     "body": [
  682.       "import React from 'react'",
  683.       "import PropTypes from 'prop-types'",
  684.       "import { connect } from 'react-redux'",
  685.       "",
  686.       "export const ${1:${TM_FILENAME_BASE}} = (props) => {",
  687.       "\treturn (",
  688.       "\t\t<div>",
  689.       "\t\t\t$0",
  690.       "\t\t</div>",
  691.       "\t)",
  692.       "}",
  693.       "",
  694.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  695.       "\t${2:props}: ${3:PropTypes}",
  696.       "}",
  697.       "",
  698.       "const mapStateToProps = (state) => ({",
  699.       "\t",
  700.       "})",
  701.       "",
  702.       "const mapDispatchToProps = {",
  703.       "\t",
  704.       "}",
  705.       "",
  706.       "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})",
  707.       ""
  708.     ],
  709.     "description": "Creates a React functional component with PropTypes with connected redux and ES7 module system"
  710.   },
  711.   "mappingToProps": {
  712.     "prefix": "reduxmap",
  713.     "body": [
  714.       "const mapStateToProps = (state) => ({",
  715.       "\t${1}",
  716.       "})",
  717.       "",
  718.       "const mapDispatchToProps = {",
  719.       "\t",
  720.       "}",
  721.       ""
  722.     ]
  723.   },
  724.   "classConstructor": {
  725.     "prefix": "rconst",
  726.     "body": [
  727.       "constructor(props) {",
  728.       "\tsuper(props)",
  729.       "",
  730.       "\tthis.state = {",
  731.       "\t\t $0",
  732.       "\t}",
  733.       "}",
  734.       ""
  735.     ],
  736.     "description": "Adds a default constructor for it('', () => {})the class that contains props as arguments"
  737.   },
  738.   "emptyState": {
  739.     "prefix": "est",
  740.     "body": ["state = {", "\t$1", "}", ""],
  741.     "description": "Creates empty state object. To be used in a constructor."
  742.   },
  743.   "componentWillMount": {
  744.     "prefix": "cwm",
  745.     "body": ["componentWillMount() {", "\t$0", "}", ""],
  746.     "description": "DEPRECATED!!!. Invoked once, both on the client and server, immediately before the initial rendering occurs"
  747.   },
  748.   "componentDidMount": {
  749.     "prefix": "cdm",
  750.     "body": ["componentDidMount() {", "\t$0", "}", ""],
  751.     "description": "Invoked once, only on the client (not on the server), immediately after the initial rendering occurs."
  752.   },
  753.   "componentWillReceiveProps": {
  754.     "prefix": "cwr",
  755.     "body": ["componentWillReceiveProps(nextProps) {", "\t$0", "}", ""],
  756.     "description": "DEPRECATED!!!. Invoked when a component is receiving new props. This method is not called for the initial render."
  757.   },
  758.   "shouldComponentUpdate": {
  759.     "prefix": "scu",
  760.     "body": ["shouldComponentUpdate(nextProps, nextState) {", "\t$0", "}", ""],
  761.     "description": "Invoked before rendering when new props or state are being received. "
  762.   },
  763.   "componentWillUpdate": {
  764.     "prefix": "cwup",
  765.     "body": ["componentWillUpdate(nextProps, nextState) {", "\t$0", "}", ""],
  766.     "description": "DEPRECATED!!!. Invoked immediately before rendering when new props or state are being received."
  767.   },
  768.   "componentDidUpdate": {
  769.     "prefix": "cdup",
  770.     "body": ["componentDidUpdate(prevProps, prevState) {", "\t$0", "}", ""],
  771.     "description": "Invoked immediately after the component's updates are flushed to the DOM."
  772.   },
  773.   "componentWillUnmount": {
  774.     "prefix": "cwun",
  775.     "body": ["componentWillUnmount() {", "\t$0", "}", ""],
  776.     "description": "Invoked immediately before a component is unmounted from the DOM."
  777.   },
  778.   "getDerivedStateFromProps": {
  779.     "prefix": "gdsfp",
  780.     "body": ["static getDerivedStateFromProps(props, state) {", "\t${1}", "}"],
  781.     "description": "Invoked right before calling the render method, both on the initial mount and on subsequent updates."
  782.   },
  783.   "getSnapshotBeforeUpdate": {
  784.     "prefix": "gsbu",
  785.     "body": [
  786.       "getSnapshotBeforeUpdate = (prevProps, prevState) => {",
  787.       "\t$0",
  788.       "}",
  789.       ""
  790.     ],
  791.     "description": "Called right before mutations are made (e.g. before the DOM is updated)"
  792.   },
  793.   "componentRender": {
  794.     "prefix": "ren",
  795.     "body": [
  796.       "render() {",
  797.       "\treturn (",
  798.       "\t\t<div>",
  799.       "\t\t\t$0",
  800.       "\t\t</div>",
  801.       "\t)",
  802.       "}"
  803.     ],
  804.     "description": "Basic render."
  805.   },
  806.   "createContext": {
  807.     "prefix": "rcontext",
  808.     "body": ["const ${1:contextName} = React.createContext()", ""],
  809.     "description": "Create React context"
  810.   },
  811.   "createRef": {
  812.     "prefix": "cref",
  813.     "body": ["this.${1:refName}Ref = React.createRef()", ""],
  814.     "description": "Create ref statement used inside constructor"
  815.   },
  816.   "forwardRef": {
  817.     "prefix": "fref",
  818.     "body": ["const ref = React.createRef()", ""],
  819.     "description": "Forward ref statement used inside component"
  820.   },
  821.   "componentSetStateObject": {
  822.     "prefix": "sst",
  823.     "body": "this.setState({$0})",
  824.     "description": "Performs a shallow merge of nextState into current state"
  825.   },
  826.   "componentSetStateFunc": {
  827.     "prefix": "ssf",
  828.     "body": ["this.setState((state, props) => { return { $0 }})", ""],
  829.     "description": "Performs a shallow merge of nextState into current state"
  830.   },
  831.   "componentProps": {
  832.     "prefix": "props",
  833.     "body": "this.props.$0",
  834.     "description": "Access component's props"
  835.   },
  836.   "componentState": {
  837.     "prefix": "state",
  838.     "body": "this.state.$0"
  839.   },
  840.   "bindThis": {
  841.     "prefix": "bnd",
  842.     "body": "this.${1:methodName} = this.${1:methodName}.bind(this)$0",
  843.     "description": "Binds this to a method"
  844.   },
  845.   "reduxAction": {
  846.     "prefix": "rxaction",
  847.     "body": [
  848.       "export const ${1:actionName} = (payload) => ({",
  849.       "\ttype: ${3:type},",
  850.       "\tpayload",
  851.       "})",
  852.       ""
  853.     ]
  854.   },
  855.   "reduxConst": {
  856.     "prefix": "rxconst",
  857.     "body": "export const ${1:constantName} = '${1:constantName}'"
  858.   },
  859.   "reduxReducer": {
  860.     "prefix": "rxreducer",
  861.     "body": [
  862.       "const initialState = {",
  863.       "",
  864.       "}",
  865.       "",
  866.       "export default (state = initialState, { type, payload }) => {",
  867.       "\tswitch (type) {",
  868.       "",
  869.       "\tcase ${1:typeName}:",
  870.       "\t\treturn { ...state, ...payload }",
  871.       "",
  872.       "\tdefault:",
  873.       "\t\treturn state",
  874.       "\t}",
  875.       "}",
  876.       ""
  877.     ]
  878.   },
  879.   "reduxSelector": {
  880.     "prefix": "rxselect",
  881.     "body": [
  882.       "import { createSelector } from 'reselect'",
  883.       "",
  884.       "export const ${1:selectorName} = state => state.${2:selector}",
  885.       ""
  886.     ]
  887.   },
  888.   "reduxSlice": {
  889.     "prefix": "rxslice",
  890.     "body": [
  891.       "import { createSlice } from '@reduxjs/toolkit'",
  892.       "",
  893.       "const initialState = {",
  894.       "",
  895.       "}",
  896.       "",
  897.       "const ${1:${TM_FILENAME_BASE}} = createSlice({",
  898.       "\tname: ${2:sliceName},",
  899.       "\tinitialState,",
  900.       "\treducers: {",
  901.       "\t",
  902.       "\t}",
  903.       "});",
  904.       "",
  905.       "export const {",
  906.       "",
  907.       "} = ${1:${TM_FILENAME_BASE}}.actions",
  908.       "export default ${1:${TM_FILENAME_BASE}}.reducer"
  909.     ]
  910.   },
  911.   "reactNativeComponent": {
  912.     "prefix": "rnc",
  913.     "body": [
  914.       "import React, { Component } from 'react'",
  915.       "import { Text, View } from 'react-native'",
  916.       "",
  917.       "export default class ${1:${TM_FILENAME_BASE}} extends Component {",
  918.       "\trender() {",
  919.       "\t\treturn (",
  920.       "\t\t\t<View>",
  921.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  922.       "\t\t\t</View>",
  923.       "\t\t)",
  924.       "\t}",
  925.       "}",
  926.       ""
  927.     ]
  928.   },
  929.   "reactNativeComponentWithStyles": {
  930.     "prefix": "rncs",
  931.     "body": [
  932.       "import React, { Component } from 'react'",
  933.       "import { Text, StyleSheet, View } from 'react-native'",
  934.       "",
  935.       "export default class ${1:${TM_FILENAME_BASE}} extends Component {",
  936.       "\trender() {",
  937.       "\t\treturn (",
  938.       "\t\t\t<View>",
  939.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  940.       "\t\t\t</View>",
  941.       "\t\t)",
  942.       "\t}",
  943.       "}",
  944.       "",
  945.       "const styles = StyleSheet.create({})",
  946.       ""
  947.     ]
  948.   },
  949.   "reactNativeComponentExport": {
  950.     "prefix": "rnce",
  951.     "body": [
  952.       "import React, { Component } from 'react'",
  953.       "import { Text, View } from 'react-native'",
  954.       "",
  955.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  956.       "\trender() {",
  957.       "\t\treturn (",
  958.       "\t\t\t<View>",
  959.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  960.       "\t\t\t</View>",
  961.       "\t\t)",
  962.       "\t}",
  963.       "}",
  964.       "",
  965.       "export default ${1:${TM_FILENAME_BASE}}",
  966.       ""
  967.     ]
  968.   },
  969.   "reactNativePureComponent": {
  970.     "prefix": "rnpc",
  971.     "body": [
  972.       "import React, { PureComponent } from 'react'",
  973.       "import { Text, View } from 'react-native'",
  974.       "",
  975.       "export default class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
  976.       "\trender() {",
  977.       "\t\treturn (",
  978.       "\t\t\t<View>",
  979.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  980.       "\t\t\t</View>",
  981.       "\t\t)",
  982.       "\t}",
  983.       "}",
  984.       ""
  985.     ]
  986.   },
  987.   "reactNativePureComponentExport": {
  988.     "prefix": "rnpce",
  989.     "body": [
  990.       "import React, { PureComponent } from 'react'",
  991.       "import { Text, View } from 'react-native'",
  992.       "",
  993.       "export class ${1:${TM_FILENAME_BASE}} extends PureComponent {",
  994.       "\trender() {",
  995.       "\t\treturn (",
  996.       "\t\t\t<View>",
  997.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  998.       "\t\t\t</View>",
  999.       "\t\t)",
  1000.       "\t}",
  1001.       "}",
  1002.       "",
  1003.       "export default ${1:${TM_FILENAME_BASE}}",
  1004.       ""
  1005.     ]
  1006.   },
  1007.   "reactNativeClassComponentRedux": {
  1008.     "prefix": "rncredux",
  1009.     "body": [
  1010.       "import React, { Component } from 'react'",
  1011.       "import { View, Text } from 'react-native'",
  1012.       "import PropTypes from 'prop-types'",
  1013.       "import { connect } from 'react-redux'",
  1014.       "",
  1015.       "export class ${1:${TM_FILENAME_BASE}} extends Component {",
  1016.       "\tstatic propTypes = {",
  1017.       "\t\t${2:prop}: ${3:PropTypes}",
  1018.       "\t}",
  1019.       "",
  1020.       "\trender() {",
  1021.       "\t\treturn (",
  1022.       "\t\t\t<View>",
  1023.       "\t\t\t\t<Text> ${2:textInComponent} </Text>",
  1024.       "\t\t\t</View>",
  1025.       "\t\t)",
  1026.       "\t}",
  1027.       "}",
  1028.       "",
  1029.       "const mapStateToProps = (state) => ({",
  1030.       "\t",
  1031.       "})",
  1032.       "",
  1033.       "const mapDispatchToProps = {",
  1034.       "\t",
  1035.       "}",
  1036.       "",
  1037.       "export default connect(mapStateToProps, mapDispatchToProps)(${1:${TM_FILENAME_BASE}})",
  1038.       ""
  1039.     ],
  1040.     "description": "Creates a React Native component class with PropTypes with connected redux and ES7 module system"
  1041.   },
  1042.   "reactNativeFunctionalExportComponent": {
  1043.     "prefix": "rnfe",
  1044.     "body": [
  1045.       "import React from 'react'",
  1046.       "import { View, Text } from 'react-native'",
  1047.       "",
  1048.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  1049.       "\treturn (",
  1050.       "\t\t<View>",
  1051.       "\t\t\t<Text>$0</Text>",
  1052.       "\t\t</View>",
  1053.       "\t)",
  1054.       "}",
  1055.       "",
  1056.       "export default ${1:${TM_FILENAME_BASE}}",
  1057.       ""
  1058.     ]
  1059.   },
  1060.   "reactNativeFunctionalExportComponentWithStyles": {
  1061.     "prefix": "rnfes",
  1062.     "body": [
  1063.       "import React from 'react'",
  1064.       "import { StyleSheet, Text, View } from 'react-native'",
  1065.       "",
  1066.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  1067.       "\treturn (",
  1068.       "\t\t<View>",
  1069.       "\t\t\t<Text>$0</Text>",
  1070.       "\t\t</View>",
  1071.       "\t)",
  1072.       "}",
  1073.       "",
  1074.       "export default ${1:${TM_FILENAME_BASE}}",
  1075.       "",
  1076.       "const styles = StyleSheet.create({})",
  1077.       ""
  1078.     ]
  1079.   },
  1080.   "reactNativeFunctionalComponent": {
  1081.     "prefix": "rnf",
  1082.     "body": [
  1083.       "import React from 'react'",
  1084.       "import { View, Text } from 'react-native'",
  1085.       "",
  1086.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  1087.       "\treturn (",
  1088.       "\t\t<View>",
  1089.       "\t\t\t<Text>$0</Text>",
  1090.       "\t\t</View>",
  1091.       "\t)",
  1092.       "}",
  1093.       ""
  1094.     ]
  1095.   },
  1096.   "reactNativeFunctionalComponentWithStyles": {
  1097.     "prefix": "rnfs",
  1098.     "body": [
  1099.       "import React from 'react'",
  1100.       "import { StyleSheet, Text, View } from 'react-native'",
  1101.       "",
  1102.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  1103.       "\treturn (",
  1104.       "\t\t<View>",
  1105.       "\t\t\t<Text>$0</Text>",
  1106.       "\t\t</View>",
  1107.       "\t)",
  1108.       "}",
  1109.       "",
  1110.       "const styles = StyleSheet.create({})",
  1111.       ""
  1112.     ]
  1113.   },
  1114.   "reactNativeImport": {
  1115.     "prefix": "imrn",
  1116.     "body": "import { ${1:moduleName} } from 'react-native'"
  1117.   },
  1118.   "reactNativeStyles": {
  1119.     "prefix": "rnstyle",
  1120.     "body": ["const styles = StyleSheet.create({", "\t${1:style}", "})", ""]
  1121.   },
  1122.   "propTypeArray": {
  1123.     "prefix": "pta",
  1124.     "body": "PropTypes.array,",
  1125.     "description": "Array prop type"
  1126.   },
  1127.   "propTypeArrayRequired": {
  1128.     "prefix": "ptar",
  1129.     "body": "PropTypes.array.isRequired,",
  1130.     "description": "Array prop type required"
  1131.   },
  1132.   "propTypeBool": {
  1133.     "prefix": "ptb",
  1134.     "body": "PropTypes.bool,",
  1135.     "description": "Bool prop type"
  1136.   },
  1137.   "propTypeBoolRequired": {
  1138.     "prefix": "ptbr",
  1139.     "body": "PropTypes.bool.isRequired,",
  1140.     "description": "Bool prop type required"
  1141.   },
  1142.   "propTypeFunc": {
  1143.     "prefix": "ptf",
  1144.     "body": "PropTypes.func,",
  1145.     "description": "Func prop type"
  1146.   },
  1147.   "propTypeFuncRequired": {
  1148.     "prefix": "ptfr",
  1149.     "body": "PropTypes.func.isRequired,",
  1150.     "description": "Func prop type required"
  1151.   },
  1152.   "propTypeNumber": {
  1153.     "prefix": "ptn",
  1154.     "body": "PropTypes.number,",
  1155.     "description": "Number prop type"
  1156.   },
  1157.   "propTypeNumberRequired": {
  1158.     "prefix": "ptnr",
  1159.     "body": "PropTypes.number.isRequired,",
  1160.     "description": "Number prop type required"
  1161.   },
  1162.   "propTypeObject": {
  1163.     "prefix": "pto",
  1164.     "body": "PropTypes.object,",
  1165.     "description": "Object prop type"
  1166.   },
  1167.   "propTypeObjectRequired": {
  1168.     "prefix": "ptor",
  1169.     "body": "PropTypes.object.isRequired,",
  1170.     "description": "Object prop type required"
  1171.   },
  1172.   "propTypeString": {
  1173.     "prefix": "pts",
  1174.     "body": "PropTypes.string,",
  1175.     "description": "String prop type"
  1176.   },
  1177.   "propTypeStringRequired": {
  1178.     "prefix": "ptsr",
  1179.     "body": "PropTypes.string.isRequired,",
  1180.     "description": "String prop type required"
  1181.   },
  1182.   "propTypeNode": {
  1183.     "prefix": "ptnd",
  1184.     "body": "PropTypes.node,",
  1185.     "description": "Anything that can be rendered: numbers, strings, elements or an array"
  1186.   },
  1187.   "propTypeNodeRequired": {
  1188.     "prefix": "ptndr",
  1189.     "body": "PropTypes.node.isRequired,",
  1190.     "description": "Anything that can be rendered: numbers, strings, elements or an array required"
  1191.   },
  1192.   "propTypeElement": {
  1193.     "prefix": "ptel",
  1194.     "body": "PropTypes.element,",
  1195.     "description": "React element prop type"
  1196.   },
  1197.   "propTypeElementRequired": {
  1198.     "prefix": "ptelr",
  1199.     "body": "PropTypes.element.isRequired,",
  1200.     "description": "React element prop type required"
  1201.   },
  1202.   "propTypeInstanceOf": {
  1203.     "prefix": "pti",
  1204.     "body": "PropTypes.instanceOf($0),",
  1205.     "description": "Is an instance of a class prop type"
  1206.   },
  1207.   "propTypeInstanceOfRequired": {
  1208.     "prefix": "ptir",
  1209.     "body": "PropTypes.instanceOf($0).isRequired,",
  1210.     "description": "Is an instance of a class prop type required"
  1211.   },
  1212.   "propTypeEnum": {
  1213.     "prefix": "pte",
  1214.     "body": "PropTypes.oneOf(['$0']),",
  1215.     "description": "Prop type limited to specific values by treating it as an enum"
  1216.   },
  1217.   "propTypeEnumRequired": {
  1218.     "prefix": "pter",
  1219.     "body": "PropTypes.oneOf(['$0']).isRequired,",
  1220.     "description": "Prop type limited to specific values by treating it as an enum required"
  1221.   },
  1222.   "propTypeOneOfType": {
  1223.     "prefix": "ptet",
  1224.     "body": ["PropTypes.oneOfType([", "\t$0", "]),"],
  1225.     "description": "An object that could be one of many types"
  1226.   },
  1227.   "propTypeOneOfTypeRequired": {
  1228.     "prefix": "ptetr",
  1229.     "body": ["PropTypes.oneOfType([", "\t$0", "]).isRequired,"],
  1230.     "description": "An object that could be one of many types required"
  1231.   },
  1232.   "propTypeArrayOf": {
  1233.     "prefix": "ptao",
  1234.     "body": "PropTypes.arrayOf($0),",
  1235.     "description": "An array of a certain type"
  1236.   },
  1237.   "propTypeArrayOfRequired": {
  1238.     "prefix": "ptaor",
  1239.     "body": "PropTypes.arrayOf($0).isRequired,",
  1240.     "description": "An array of a certain type required"
  1241.   },
  1242.   "propTypeObjectOf": {
  1243.     "prefix": "ptoo",
  1244.     "body": "PropTypes.objectOf($0),",
  1245.     "description": "An object with property values of a certain type"
  1246.   },
  1247.   "propTypeObjectOfRequired": {
  1248.     "prefix": "ptoor",
  1249.     "body": "PropTypes.objectOf($0).isRequired,",
  1250.     "description": "An object with property values of a certain type required"
  1251.   },
  1252.   "propTypeShape": {
  1253.     "prefix": "ptsh",
  1254.     "body": ["PropTypes.shape({", "\t$0", "}),"],
  1255.     "description": "An object taking on a particular shape"
  1256.   },
  1257.   "propTypeShapeRequired": {
  1258.     "prefix": "ptshr",
  1259.     "body": ["PropTypes.shape({", "\t$0", "}).isRequired,"],
  1260.     "description": "An object taking on a particular shape required"
  1261.   },
  1262.   "propTypeExact": {
  1263.     "prefix": "ptex",
  1264.     "body": ["PropTypes.exact({", "\t$0", "}),"],
  1265.     "description": "An object with warnings on extra properties"
  1266.   },
  1267.   "propTypeExactRequired": {
  1268.     "prefix": "ptexr",
  1269.     "body": ["PropTypes.exact({", "\t$0", "}).isRequired,"],
  1270.     "description": "An object with warnings on extra properties required"
  1271.   },
  1272.   "staticPropTpyes": {
  1273.     "prefix": "ptypes",
  1274.     "body": ["static propTypes = {", "$0", "}", ""]
  1275.   },
  1276.   "propTypeAny": {
  1277.     "prefix": "ptany",
  1278.     "body": "PropTypes.any,",
  1279.     "description": "Any prop type"
  1280.   },
  1281.   "Comment Big Block": {
  1282.     "prefix": "cmmb",
  1283.     "body": ["/**", " * ${0}", " */"]
  1284.   },
  1285.   "describeBlock": {
  1286.     "prefix": "desc",
  1287.     "body": ["describe('$1', () => {", "\t$0", "})", ""],
  1288.     "description": "Testing `describe` block"
  1289.   },
  1290.   "testBlock": {
  1291.     "prefix": "test",
  1292.     "body": ["test('should $1', () => {", "\t$0", "})", ""],
  1293.     "description": "Testing `test` block"
  1294.   },
  1295.   "testAsyncBlock": {
  1296.     "prefix": "testa",
  1297.     "body": ["test('should $1', async () => {", "\t$0", "})", ""],
  1298.     "description": "Testing `asynchronous test` block"
  1299.   },
  1300.   "itBlock": {
  1301.     "prefix": "tit",
  1302.     "body": ["it('should $1', () => {", "\t$0", "})", ""],
  1303.     "description": "Testing `it` block"
  1304.   },
  1305.   "itAsyncBlock": {
  1306.     "prefix": "tita",
  1307.     "body": ["it('should $1', async () => {", "\t$0", "})", ""],
  1308.     "description": "Testing asynchronous `it` block"
  1309.   },
  1310.   "setupReactTest": {
  1311.     "prefix": "stest",
  1312.     "body": [
  1313.       "import React from 'react'",
  1314.       "import renderer from 'react-test-renderer'",
  1315.       "",
  1316.       "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'",
  1317.       "",
  1318.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1319.       "\tconst defaultProps = {}",
  1320.       "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)",
  1321.       "",
  1322.       "\ttest('render', () => {",
  1323.       "\t\texpect(wrapper).toMatchSnapshot()",
  1324.       "\t})",
  1325.       "})",
  1326.       ""
  1327.     ]
  1328.   },
  1329.   "setupReactNativeTest": {
  1330.     "prefix": "sntest",
  1331.     "body": [
  1332.       "import 'react-native'",
  1333.       "import React from 'react'",
  1334.       "import renderer from 'react-test-renderer'",
  1335.       "",
  1336.       "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'",
  1337.       "",
  1338.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1339.       "\tconst defaultProps = {}",
  1340.       "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)",
  1341.       "",
  1342.       "\ttest('render', () => {",
  1343.       "\t\texpect(wrapper).toMatchSnapshot()",
  1344.       "\t})",
  1345.       "})",
  1346.       ""
  1347.     ]
  1348.   },
  1349.   "setupReactComponentTestWithRedux": {
  1350.     "prefix": "srtest",
  1351.     "body": [
  1352.       "import React from 'react'",
  1353.       "import renderer from 'react-test-renderer'",
  1354.       "import { Provider } from 'react-redux'",
  1355.       "",
  1356.       "import store from 'src/store'",
  1357.       "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'",
  1358.       "",
  1359.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1360.       "\tconst defaultProps = {}",
  1361.       "\tconst wrapper = renderer.create(",
  1362.       "\t\t<Provider store={store}>",
  1363.       "\t\t <${1:${TM_FILENAME_BASE}} {...defaultProps} />",
  1364.       "\t\t</Provider>,",
  1365.       "\t)",
  1366.       "",
  1367.       "\ttest('render', () => {",
  1368.       "\t\texpect(wrapper).toMatchSnapshot()",
  1369.       "\t})",
  1370.       "})",
  1371.       ""
  1372.     ],
  1373.     "description": "Create test component"
  1374.   },
  1375.   "setupReactNativeTestWithRedux": {
  1376.     "prefix": "snrtest",
  1377.     "body": [
  1378.       "import 'react-native'",
  1379.       "import React from 'react'",
  1380.       "import renderer from 'react-test-renderer'",
  1381.       "import { Provider } from 'react-redux'",
  1382.       "",
  1383.       "import store from 'src/store'",
  1384.       "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'",
  1385.       "",
  1386.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1387.       "\tconst defaultProps = {}",
  1388.       "\tconst wrapper = renderer.create(",
  1389.       "\t\t<Provider store={store}>",
  1390.       "\t\t\t<${1:${TM_FILENAME_BASE}} {...defaultProps} />",
  1391.       "\t\t</Provider>,",
  1392.       "\t)",
  1393.       "",
  1394.       "\ttest('render', () => {",
  1395.       "\t\texpect(wrapper).toMatchSnapshot()",
  1396.       "\t})",
  1397.       "})",
  1398.       ""
  1399.     ]
  1400.   },
  1401.   "graphQLForComponent": {
  1402.     "prefix": "graphql",
  1403.     "body": ["import { compose, graphql } from 'react-apollo'", ""]
  1404.   },
  1405.   "exportGraphQL": {
  1406.     "prefix": "expgql",
  1407.     "body": [
  1408.       "export default compose(",
  1409.       "\tgraphql(${1:queryOrMutation}, { name: ${2:name} }),",
  1410.       ")(${1:${TM_FILENAME_BASE}})"
  1411.     ]
  1412.   },
  1413.   "hocComponentWithRedux": {
  1414.     "prefix": "hocredux",
  1415.     "body": [
  1416.       "import React from 'react'",
  1417.       "import PropTypes from 'prop-types'",
  1418.       "import { connect } from 'react-redux'",
  1419.       "",
  1420.       "export const mapStateToProps = state => ({",
  1421.       "",
  1422.       "})",
  1423.       "",
  1424.       "export const mapDispatchToProps = {",
  1425.       " ",
  1426.       "}",
  1427.       "",
  1428.       "export const ${1:hocComponentName} = (WrappedComponent) => {",
  1429.       "\tconst hocComponent = ({ ...props }) => <WrappedComponent {...props} />",
  1430.       "",
  1431.       "\thocComponent.propTypes = {",
  1432.       "\t}",
  1433.       "",
  1434.       "\treturn hocComponent",
  1435.       "}",
  1436.       "",
  1437.       "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))",
  1438.       ""
  1439.     ]
  1440.   },
  1441.   "hocComponent": {
  1442.     "prefix": "hoc",
  1443.     "body": [
  1444.       "import React from 'react'",
  1445.       "import PropTypes from 'prop-types'",
  1446.       "",
  1447.       "export default (WrappedComponent) => {",
  1448.       "\tconst hocComponent = ({ ...props }) => <WrappedComponent {...props} />",
  1449.       "",
  1450.       "\thocComponent.propTypes = {",
  1451.       "\t}",
  1452.       "",
  1453.       "\treturn hocComponent",
  1454.       "}",
  1455.       ""
  1456.     ]
  1457.   },
  1458.   "useState": {
  1459.     "prefix": "useState",
  1460.     "body": [
  1461.       "const [${1:state}, set${1/(.*)/${1:/capitalize}/}] = useState(${2:initialState})"
  1462.     ]
  1463.   },
  1464.   "useEffect": {
  1465.     "prefix": "useEffect",
  1466.     "body": [
  1467.       "useEffect(() => {",
  1468.       "\t${1:effect}",
  1469.       "\treturn () => {",
  1470.       "\t\t${2:cleanup}",
  1471.       "\t}",
  1472.       "}, [${3:input}])"
  1473.     ]
  1474.   },
  1475.   "useContext": {
  1476.     "prefix": "useContext",
  1477.     "body": ["const ${1:context} = useContext(${2:contextValue})"]
  1478.   },
  1479.   "useReducer": {
  1480.     "prefix": "useReducer",
  1481.     "body": [
  1482.       "const [state, dispatch] = useReducer(${1:reducer}, ${2:initialState}, ${3:init})"
  1483.     ]
  1484.   },
  1485.   "useCallback": {
  1486.     "prefix": "useCallback",
  1487.     "body": [
  1488.       "useCallback(",
  1489.       "\t() => {",
  1490.       "\t\t${1:callback}",
  1491.       "\t},",
  1492.       "\t[${2:input}],",
  1493.       ")"
  1494.     ]
  1495.   },
  1496.   "useMemo": {
  1497.     "prefix": "useMemo",
  1498.     "body": ["useMemo(() => ${1:function}, ${2:input})"]
  1499.   },
  1500.   "useRef": {
  1501.     "prefix": "useRef",
  1502.     "body": ["const ${1:ref} = useRef(${2:initialValue})"]
  1503.   },
  1504.   "useImperativeHandle": {
  1505.     "prefix": "useImperativeHandle",
  1506.     "body": [
  1507.       "useImperativeHandle(",
  1508.       "\t${1:ref},",
  1509.       "\t() => {",
  1510.       "\t\t${2:handler}",
  1511.       "\t},",
  1512.       "\t[${3:input}],",
  1513.       ")"
  1514.     ]
  1515.   },
  1516.   "useDebugValue": {
  1517.     "prefix": "useDebugValue",
  1518.     "body": ["useDebugValue(${1:value})"]
  1519.   },
  1520.   "useLayoutEffect": {
  1521.     "prefix": "useLayoutEffect",
  1522.     "body": [
  1523.       "useLayoutEffect(() => {",
  1524.       "\t${1:effect}",
  1525.       "\treturn () => {",
  1526.       "\t\t${2:cleanup}",
  1527.       "\t};",
  1528.       "}, [${3:input}])"
  1529.     ]
  1530.   },
  1531.   "useSelector": {
  1532.     "prefix": "useSelector",
  1533.     "body": ["const ${1:state} = useSelector(state => state.${1:state})"]
  1534.   },
  1535.   "useDispatch": {
  1536.     "prefix": "useDispatch",
  1537.     "body": ["const dispatch = useDispatch(${1:function})"]
  1538.   },
  1539.   "typeof": {
  1540.     "prefix": "tpf",
  1541.     "body": ["typeof ${0}"]
  1542.   },
  1543.   "_reactFunctionalExportComponent": {
  1544.     "prefix": "_rfce",
  1545.     "body": [
  1546.       "function ${1:${TM_FILENAME_BASE}}() {",
  1547.       "\treturn (",
  1548.       "\t\t<div>",
  1549.       "\t\t\t$0",
  1550.       "\t\t</div>",
  1551.       "\t)",
  1552.       "}",
  1553.       "",
  1554.       "export default ${1:${TM_FILENAME_BASE}}",
  1555.       ""
  1556.     ],
  1557.     "description": "Creates a React 17 Functional Component with ES7 module system"
  1558.   },
  1559.   "_reactFunctionalComponent": {
  1560.     "prefix": "_rfc",
  1561.     "body": [
  1562.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  1563.       "\treturn (",
  1564.       "\t\t<div>",
  1565.       "\t\t\t$0",
  1566.       "\t\t</div>",
  1567.       "\t)",
  1568.       "}",
  1569.       ""
  1570.     ],
  1571.     "description": "Creates a React 17 Functional Component with ES7 module system"
  1572.   },
  1573.   "_reactFunctionalComponentWithPropTypes": {
  1574.     "prefix": "_rfcp",
  1575.     "body": [
  1576.       "import PropTypes from 'prop-types'",
  1577.       "",
  1578.       "function ${1:${TM_FILENAME_BASE}}(props) {",
  1579.       "\treturn (",
  1580.       "\t\t<div>",
  1581.       "\t\t\t$0",
  1582.       "\t\t</div>",
  1583.       "\t)",
  1584.       "}",
  1585.       "",
  1586.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  1587.       "",
  1588.       "}",
  1589.       "",
  1590.       "export default ${1:${TM_FILENAME_BASE}}",
  1591.       "",
  1592.       ""
  1593.     ],
  1594.     "description": "Creates a React 17 Functional Component with ES7 module system with PropTypes"
  1595.   },
  1596.   "_reactArrowFunctionExportComponent": {
  1597.     "prefix": "_rafce",
  1598.     "body": [
  1599.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  1600.       "\treturn (",
  1601.       "\t\t<div>",
  1602.       "\t\t\t$0",
  1603.       "\t\t</div>",
  1604.       "\t)",
  1605.       "}",
  1606.       "",
  1607.       "export default ${1:${TM_FILENAME_BASE}}",
  1608.       ""
  1609.     ],
  1610.     "description": "Creates a React 17 Arrow Function Component with ES7 module system"
  1611.   },
  1612.   "_reactArrowFunctionComponent": {
  1613.     "prefix": "_rafc",
  1614.     "body": [
  1615.       "export const ${1:${TM_FILENAME_BASE}} = () => {",
  1616.       "\treturn (",
  1617.       "\t\t<div>",
  1618.       "\t\t\t$0",
  1619.       "\t\t</div>",
  1620.       "\t)",
  1621.       "}",
  1622.       ""
  1623.     ],
  1624.     "description": "Creates a React 17 Arrow Function Component with ES7 module system"
  1625.   },
  1626.   "_reactArrowFunctionComponentWithPropTypes": {
  1627.     "prefix": "_rafcp",
  1628.     "body": [
  1629.       "import PropTypes from 'prop-types'",
  1630.       "",
  1631.       "const ${1:${TM_FILENAME_BASE}} = props => {",
  1632.       "\treturn (",
  1633.       "\t\t<div>",
  1634.       "\t\t\t$0",
  1635.       "\t\t</div>",
  1636.       "\t)",
  1637.       "}",
  1638.       "",
  1639.       "${1:${TM_FILENAME_BASE}}.propTypes = {",
  1640.       "",
  1641.       "}",
  1642.       "",
  1643.       "export default ${1:${TM_FILENAME_BASE}}",
  1644.       ""
  1645.     ],
  1646.     "description": "Creates a React 17 Arrow Function Component with ES7 module system with PropTypes"
  1647.   },
  1648.   "_reactNativeFunctionalExportComponent": {
  1649.     "prefix": "_rnfe",
  1650.     "body": [
  1651.       "import { View, Text } from 'react-native'",
  1652.       "",
  1653.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  1654.       "\treturn (",
  1655.       "\t\t<View>",
  1656.       "\t\t\t<Text>$0</Text>",
  1657.       "\t\t</View>",
  1658.       "\t)",
  1659.       "}",
  1660.       "",
  1661.       "export default ${1:${TM_FILENAME_BASE}}",
  1662.       ""
  1663.     ]
  1664.   },
  1665.   "_reactNativeFunctionalExportComponentWithStyles": {
  1666.     "prefix": "_rnfes",
  1667.     "body": [
  1668.       "import { StyleSheet, Text, View } from 'react-native'",
  1669.       "",
  1670.       "const ${1:${TM_FILENAME_BASE}} = () => {",
  1671.       "\treturn (",
  1672.       "\t\t<View>",
  1673.       "\t\t\t<Text>$0</Text>",
  1674.       "\t\t</View>",
  1675.       "\t)",
  1676.       "}",
  1677.       "",
  1678.       "export default ${1:${TM_FILENAME_BASE}}",
  1679.       "",
  1680.       "const styles = StyleSheet.create({})",
  1681.       ""
  1682.     ]
  1683.   },
  1684.   "_reactNativeFunctionalComponent": {
  1685.     "prefix": "_rnf",
  1686.     "body": [
  1687.       "import { View, Text } from 'react-native'",
  1688.       "",
  1689.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  1690.       "\treturn (",
  1691.       "\t\t<View>",
  1692.       "\t\t\t<Text>$0</Text>",
  1693.       "\t\t</View>",
  1694.       "\t)",
  1695.       "}",
  1696.       ""
  1697.     ]
  1698.   },
  1699.   "_reactNativeFunctionalComponentWithStyles": {
  1700.     "prefix": "_rnfs",
  1701.     "body": [
  1702.       "import { StyleSheet, Text, View } from 'react-native'",
  1703.       "",
  1704.       "export default function ${1:${TM_FILENAME_BASE}}() {",
  1705.       "\treturn (",
  1706.       "\t\t<View>",
  1707.       "\t\t\t<Text>$0</Text>",
  1708.       "\t\t</View>",
  1709.       "\t)",
  1710.       "}",
  1711.       "",
  1712.       "const styles = StyleSheet.create({})",
  1713.       ""
  1714.     ]
  1715.   },
  1716.   "_setupReactTest": {
  1717.     "prefix": "_stest",
  1718.     "body": [
  1719.       "import renderer from 'react-test-renderer'",
  1720.       "",
  1721.       "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'",
  1722.       "",
  1723.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1724.       "\tconst defaultProps = {}",
  1725.       "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)",
  1726.       "",
  1727.       "\ttest('render', () => {",
  1728.       "\t\texpect(wrapper).toMatchSnapshot()",
  1729.       "\t})",
  1730.       "})",
  1731.       ""
  1732.     ]
  1733.   },
  1734.   "_setupReactNativeTest": {
  1735.     "prefix": "_sntest",
  1736.     "body": [
  1737.       "import 'react-native'",
  1738.       "import renderer from 'react-test-renderer'",
  1739.       "",
  1740.       "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'",
  1741.       "",
  1742.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1743.       "\tconst defaultProps = {}",
  1744.       "\tconst wrapper = renderer.create(<${1:${TM_FILENAME_BASE}} {...defaultProps} />)",
  1745.       "",
  1746.       "\ttest('render', () => {",
  1747.       "\t\texpect(wrapper).toMatchSnapshot()",
  1748.       "\t})",
  1749.       "})",
  1750.       ""
  1751.     ]
  1752.   },
  1753.   "_setupReactComponentTestWithRedux": {
  1754.     "prefix": "_srtest",
  1755.     "body": [
  1756.       "import renderer from 'react-test-renderer'",
  1757.       "import { Provider } from 'react-redux'",
  1758.       "",
  1759.       "import store from 'src/store'",
  1760.       "import { ${1:${TM_FILENAME_BASE}} } from '../${1:${TM_FILENAME_BASE}}'",
  1761.       "",
  1762.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1763.       "\tconst defaultProps = {}",
  1764.       "\tconst wrapper = renderer.create(",
  1765.       "\t\t<Provider store={store}>",
  1766.       "\t\t <${1:${TM_FILENAME_BASE}} {...defaultProps} />",
  1767.       "\t\t</Provider>,",
  1768.       "\t)",
  1769.       "",
  1770.       "\ttest('render', () => {",
  1771.       "\t\texpect(wrapper).toMatchSnapshot()",
  1772.       "\t})",
  1773.       "})",
  1774.       ""
  1775.     ],
  1776.     "description": "Create test component"
  1777.   },
  1778.   "_setupReactNativeTestWithRedux": {
  1779.     "prefix": "_snrtest",
  1780.     "body": [
  1781.       "import 'react-native'",
  1782.       "import renderer from 'react-test-renderer'",
  1783.       "import { Provider } from 'react-redux'",
  1784.       "",
  1785.       "import store from 'src/store'",
  1786.       "import ${1:${TM_FILENAME_BASE}} from '../${1:${TM_FILENAME_BASE}}'",
  1787.       "",
  1788.       "describe('<${1:${TM_FILENAME_BASE}} />', () => {",
  1789.       "\tconst defaultProps = {}",
  1790.       "\tconst wrapper = renderer.create(",
  1791.       "\t\t<Provider store={store}>",
  1792.       "\t\t\t<${1:${TM_FILENAME_BASE}} {...defaultProps} />",
  1793.       "\t\t</Provider>,",
  1794.       "\t)",
  1795.       "",
  1796.       "\ttest('render', () => {",
  1797.       "\t\texpect(wrapper).toMatchSnapshot()",
  1798.       "\t})",
  1799.       "})",
  1800.       ""
  1801.     ]
  1802.   },
  1803.   "_hocComponentWithRedux": {
  1804.     "prefix": "_hocredux",
  1805.     "body": [
  1806.       "import PropTypes from 'prop-types'",
  1807.       "import { connect } from 'react-redux'",
  1808.       "",
  1809.       "export const mapStateToProps = state => ({",
  1810.       "",
  1811.       "})",
  1812.       "",
  1813.       "export const mapDispatchToProps = {",
  1814.       " ",
  1815.       "}",
  1816.       "",
  1817.       "export const ${1:hocComponentName} = (WrappedComponent) => {",
  1818.       "\tconst hocComponent = ({ ...props }) => <WrappedComponent {...props} />",
  1819.       "",
  1820.       "\thocComponent.propTypes = {",
  1821.       "\t}",
  1822.       "",
  1823.       "\treturn hocComponent",
  1824.       "}",
  1825.       "",
  1826.       "export default WrapperComponent => connect(mapStateToProps, mapDispatchToProps)(${1:hocComponentName}(WrapperComponent))",
  1827.       ""
  1828.     ]
  1829.   },
  1830.   "_hocComponent": {
  1831.     "prefix": "_hoc",
  1832.     "body": [
  1833.       "import PropTypes from 'prop-types'",
  1834.       "",
  1835.       "export default (WrappedComponent) => {",
  1836.       "\tconst hocComponent = ({ ...props }) => <WrappedComponent {...props} />",
  1837.       "",
  1838.       "\thocComponent.propTypes = {",
  1839.       "\t}",
  1840.       "",
  1841.       "\treturn hocComponent",
  1842.       "}",
  1843.       ""
  1844.     ]
  1845.   }
  1846. }
  1847.  
Add Comment
Please, Sign In to add comment