Skip to content

Instantly share code, notes, and snippets.

@dmurawsky
Last active June 10, 2018 17:40
Show Gist options
  • Save dmurawsky/229262c5b74179823f86ca4034ae8ce8 to your computer and use it in GitHub Desktop.
Save dmurawsky/229262c5b74179823f86ca4034ae8ce8 to your computer and use it in GitHub Desktop.
VS Code snippets
{
"Print to console": {
"scope": "javascript,typescript",
"prefix": "log",
"body": [
"console.log('$1', $2);"
],
"description": "Log output to console"
},
"prettier": {
"scope": "json",
"prefix": "prettier",
"body": [
"\"prettier\": {",
"\t\"semi\": false,",
"\t\"singleQuote\": true,",
"\t\"trailingComma\": \"all\"",
"},",
],
"description": "Log output to console"
},
"Basic Redux Component": {
"scope": "javascript",
"prefix": "basic-redux",
"body": [
"import React from 'react'",
"import {connect} from 'react-redux'",
"",
"export const $1 = ({$2}) => <pre>{JSON.stringify($2, null, 2)}</pre>",
"",
"export const mapStateToProps = ({$2}) => ({$2})",
"export const mapDispatchToProps = d => ({$3: payload => ({type: '$4', payload}) })",
"",
"export default connect(mapStateToProps, mapDispatchToProps)($1)",
],
"description": "Template for basic redux connected component"
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment