This is a collection of axios API snippets for Sublime Text
Use Sublime Text's Package Control (Preferences -> Package Control -> Install Package -> Axios Snippets) to install this package.
-
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 });
If you have any ideas and new features, please fork and create a pull request to repository.