Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
61 lines (60 sloc) 1.5 KB
{
"Function": {
"prefix": "fn",
"body": ["function ${1:init}($2) {", " $3", "}$4"],
"description": "A plain JS function"
},
"Loggy": {
"prefix": "loggy",
"body": ["console.log('${1}: ', $1);$2"],
"description": "Log variable (or whatever) including a label to console"
},
"Log": {
"prefix": "clog",
"body": ["console.log($1);$2"],
"description": "Log variable (or whatever) to console"
},
"Timer": {
"prefix": "timer",
"body": [
"console.time('${1:function}');",
"console.timeEnd('${1:function}');$2"
],
"description": "Back to the future"
},
"React className": {
"prefix": "cN",
"body": ["className={styles.$1}"],
"description": "Use a React className via styles (CSS Modules)"
},
"Import Component's Styles": {
"prefix": "import styles",
"body": ["import styles from './${1:style.m}.less';"],
"description": "Import Component's Styles (CSS Modules)"
},
"rel noopener noreferrer": {
"prefix": "rel",
"body": ["rel=\"noopener noreferrer\""],
"description": "Secure that link"
},
"React Class Component": {
"prefix": "component",
"body": [
"import { Component } from 'react';",
"import PropTypes from 'prop-types';",
"",
"class ${1:MyComponent} extends Component {",
" state = {$2};",
" render() {",
" return <>${3:Hi}</>;",
" }",
"}",
"${1:MyComponent}.propTypes = {",
" ${4:// TODO!}",
"};",
"",
"export default ${1:MyComponent};$5"
],
"description": "A React class component with state"
}
}