Skip to content

cvhau/sublime-axios-snippets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Axios Snippets For Sublime Text

This is a collection of axios API snippets for Sublime Text

Installation

Use Sublime Text's Package Control (Preferences -> Package Control -> Install Package -> Axios Snippets) to install this package.

Snippets

  • axios

    axios({
      method: 'get',
      url: '',
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.request | axiosr

    axios.request({
      method: 'get',
      url: '',
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.get | axiosge

    axios.get('url', {
      params: {
        key: 'value',
      },
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.delete | axiosde

    axios.delete('url').then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.head | axioshe

    axios.head('url').then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.options | axiosop

    axios.options('url').then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.post | axiospo

    axios.post('url', {
      key: 'value',
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.put | axiospu

    axios.put('url', {
      key: 'value',
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.patch | axiospa

    axios.patch('url', {
      key: 'value',
    }).then((response) => {
      // TODO
    }).catch((error) => {
      console.error(error);
    }).finally(() => {
      // TODO
    });
  • axios.create | axioscr

    axios.create({
      baseURL: 'base-url',
      timeout: 5000,
      headers: {
        'X-Requested-With': 'XMLHttpRequest',
      }
    });

 

#####Also support some Promise commands

  • promise new | Promise new.

    new Promise((resolve, reject) => {
      // TODO
    });
  • promise | Promise

    Promise((resolve, reject) => {
      // TODO
    });

Contributions

If you have any ideas and new features, please fork and create a pull request to repository.

About

A collections of [axios](https://github.com/axios/axios) API snippets for [Sublime Text](http://www.sublimetext.com)

Resources

License

Stars

Watchers

Forks

Packages

No packages published