https://github.com/code4mk/atom-axios
:atom: Atom Axios snippet package
https://github.com/code4mk/atom-axios
atom-package axios axios-atom axios-snippet vue
Last synced: 8 months ago
JSON representation
:atom: Atom Axios snippet package
- Host: GitHub
- URL: https://github.com/code4mk/atom-axios
- Owner: code4mk
- License: mit
- Created: 2017-08-31T18:45:40.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2017-10-13T17:46:23.000Z (about 8 years ago)
- Last Synced: 2025-02-19T12:55:23.569Z (9 months ago)
- Topics: atom-package, axios, axios-atom, axios-snippet, vue
- Homepage: https://hellolaravel.org
- Size: 17.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ⚛️ Atom Axios {vue.js , laravel , js}

> laravel-> vue ->axios atom package by @code4mk
Install:
```ssh
apm install atom-axios
```
Mian Features:
- Snippet Axios on vue
Version:
- axios 0.1.0
## Snippet list
|Snippet short| Description|
|----|-----------|
| ax-g | axios get all components |
| ax-gp | axios get with params |
| ax-mg | axios multiple get |
| ax-p | axios post all components |
| ax-get | axios only get |
| ax-then | axios only then |
| ax-catch | axios only catch |
| ax-bind | `this` issue solve by bind |
# ax-g
```js
axios.get('/user?ID=12345')
.then(function (response){
// Getting Data from response
})
.catch(function (error){
console.log(error);
});
```
# ax-gp
```js
axios.get('/user',{
params:{
ID: 12345
}
})
.then(function (response){
//Getting data from response
})
.catch( function (error){
console.log(error);
});
```
# ax-mg
```js
function getUserAccount() {
return axios.get('/user/12345');
}
function getUserPermissions() {
return axios.get('/user/12345/permissions');
}
axios.all([getUserAccount(), getUserPermissions()])
.then(axios.spread(function (acct, perms) {
// Both requests are now complete
}));
```
# ax-p
```js
axios.post('/user',{
firstName: 'code4mk',
lastName: 'Hello-laravel'
})
.then(function (response){
//Getting data from response
})
.catch( function (error){
// Describe error!
});
```
# issue if can't access by `this` . follow this
```js
axios.get('/user?ID=12345')
.then(function (response){
// Getting Data from response
}.bind(this))
.catch(function (error){
console.log(error);
});
```
### Axios
* [Axios](https://github.com/mzabriskie/axios)
---
> [@code4mk](https://twitter.com/code4mk) // ~ [Hello Laravel](https://twitter.com/hellolaravelbd)