Skip to content

Instantly share code, notes, and snippets.

@IAmNatch
Created May 7, 2020 21:43
Show Gist options
  • Save IAmNatch/9f6cb0abc568753bfcc65fa0ec063462 to your computer and use it in GitHub Desktop.
Save IAmNatch/9f6cb0abc568753bfcc65fa0ec063462 to your computer and use it in GitHub Desktop.
{
"scope": "javascript,typescript,javascriptreact",
"Redux Thunk": {
"prefix": "thunk",
"body": [
"export const ${1:FunctionName} = () => {",
" return dispatch => {",
" dispatch({type: ${2:CONSTANT_NAME}})",
" }",
"}"
],
"description": "A dispatcher inside of an action"
},
"React Functional Component": {
"prefix": "rfc",
"body": [
"export const ${1:FunctionName} = (props) => {",
" return (",
" <div>I'm a weenie</div>",
" )",
"}"
]
},
"console.log": {
"prefix": "csl",
"body": [
"console.log('$1', $2)"
]
},
"console.log a value": {
"prefix": "cslv",
"body": [
"console.log('$1', $1)"
]
},
"Redux Connect": {
"prefix": "recon",
"body": [
"const mapStateToProps = state => {",
" return {",
" }",
"}",
"",
"const mapDispatchToProps = dispatch => {",
" return {",
" }",
"}",
"export const ${1:ExportName} = connect(",
" mapStateToProps,",
" mapDispatchToProps",
")(${2:ComponentName})"
],
"description": "Redux Connect"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment