Created
July 20, 2020 17:29
-
-
Save tonymamo/4fc5ba672d24583a67d34b6a386aa549 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
Show hidden characters
{ | |
"FSA Type Creator Name": { | |
"scope": "javascript,typescript", | |
"prefix": "fsa", | |
"body": [ | |
"export const ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_REQUEST = '${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_REQUEST';", | |
"export const ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_SUCCESS = '${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_SUCCESS';", | |
"export const ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_FAILURE = '${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_FAILURE';", | |
"", | |
"export const ${1} = (payload: ${2}) => ({", | |
" [RSAA]: {", | |
" endpoint: ${3},", | |
" method: '${4}',", | |
" body: JSON.stringify(payload),", | |
" types: [", | |
" ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_REQUEST,", | |
" ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_SUCCESS,", | |
" ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_FAILURE,", | |
" ]", | |
" },", | |
"});" | |
], | |
"description": "Creates Request, Success, Failure FSA type names" | |
} | |
} |
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
{ | |
"FSA Type Creator Name": { | |
"scope": "javascript,typescript", | |
"prefix": "fsaType", | |
"body": [ | |
"export type $1RequestAction = {", | |
" type: typeof ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_REQUEST;", | |
"};", | |
"export type $1SuccessAction = {", | |
" type: typeof ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_SUCCESS;", | |
" payload: ${2};", | |
"};", | |
"export type $1FailureAction = {", | |
" type: typeof ${1/([a-z]*)(([A-Z])+([a-z]+))?/${1:/upcase}${2:+_}$3${4:/upcase}/g}_FAILURE;", | |
"};", | |
"| $1RequestAction", | |
"| $1SuccessAction", | |
"| $1FailureAction" | |
], | |
"description": "Creates Request, Success, Failure FSA type names" | |
} | |
} |
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
{ | |
"Function Component Snippet": { | |
"scope": "javascript,typescript", | |
"prefix": "funcComp", | |
"body": [ | |
"import React, { FunctionComponent } from 'react';", | |
"", | |
"type ${1}Props = {};", | |
"", | |
"const ${1}: FunctionComponent<${1}Props> = () => {", | |
"", | |
" return (", | |
" <${2}>", | |
" ${3}", | |
" </${2}>", | |
" );", | |
"};", | |
"", | |
"export default ${1};", | |
"" | |
], | |
"description": "Creates Request, Success, Failure FSA type names" | |
} | |
} |
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
{} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment