Created
May 7, 2020 21:43
-
-
Save IAmNatch/68117f832ba8e2d5351a00096373036c 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