Skip to content

[Feat] - Add axios and styled-components snippets(fapi, scr, scrd) #143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -678,6 +678,37 @@ export default connect(mapStateToProps, mapDispatchToProps)(FileName)

## Others

### `fapi`

```javascript
import axios from 'axios';

const ${1:api} = axios.create({
baseURL: '${2:url}',
});

export default ${1:api};

```

### `scr`

```javascript
import styled from 'styled-components';

export const ${1:Main} = styled.${2:div}`
${3}
`;
```

### `scrd`

```javascript
export const ${1:Main} = styled.${2:div}`
${3}
`;
```

### `cmmb`

```JS
Expand Down
41 changes: 41 additions & 0 deletions snippets/snippets.json
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,23 @@
"body": ["const { $1 } = this.state"],
"description": "Creates and assigns a local variable using state destructing"
},

"createApiFile": {
"prefix": "fapi",
"body": [
"import axios from 'axios';",
"",
"const ${1:api} = axios.create({",
" baseURL: '${2:url}',",
"});",
"",
"export default ${1:api};",
""
],
"description": "create api file witch axios"
},


"import React": {
"prefix": "imr",
"body": ["import React from 'react'", ""]
Expand Down Expand Up @@ -852,6 +869,30 @@
""
]
},
"stylesComponents": {
"prefix": "scr",
"body": [
"import styled from 'styled-components';",
"",
"export const ${1:Main} = styled.${2:div}`",
" ${3}",
"`;",
""
],
"description": "Create ReactJS Styled Components file"
},

"stylesComponentsDiv": {
"prefix": "scrd",
"body": [

"export const ${1:Main} = styled.${2:div}`",
" ${3}",
"`;",
""
],
"description": "Create Div Styled Components"
},
"reduxConst": {
"prefix": "rxconst",
"body": "export const ${1:constantName} = '${1:constantName}'"
Expand Down