Skip to content

code4mk/atom-axios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚛️ Atom Axios {vue.js , laravel , js}

laravel-> vue ->axios atom package by @code4mk

Install:

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

axios.get('/user?ID=12345')
  .then(function (response){
    // Getting Data from response
  })
  .catch(function (error){
    console.log(error);
  });

ax-gp

axios.get('/user',{
  params:{
    ID: 12345
  }
})
  .then(function (response){
   //Getting data from response
  })
  .catch( function (error){
    console.log(error);
  });

ax-mg

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

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

axios.get('/user?ID=12345')
  .then(function (response){
    // Getting Data from response
  }.bind(this))
  .catch(function (error){
    console.log(error);
  });

Axios


@code4mk // ~ Hello Laravel