Created
May 7, 2020 21:43
-
-
Save IAmNatch/9f6cb0abc568753bfcc65fa0ec063462 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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