Skip to content

A deadsimple module to use Axios components in your Magento2 projects

Notifications You must be signed in to change notification settings

Deadsimple-ecommerce/AxiosLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Latest Stable Version Total Downloads License

Deadsimple Axios Magento2 Composer Library

This package allows you to include the latest version of axios and use on a global level together with requirejs in your Magento2 setup straight out of the box

Installation

Use composer to install the module: composer require deadsimple/axioslibrary

Usage

Using this library is easy peasy, just include the axios script through requirejs, define Axios and use it wherever you like.

define([
  'Axios'
], function (axios) {
  'use strict';
  
  // Make a request for a user with a given ID
  axios.get('/user?ID=12345')
    .then(function (response) {
      // handle success
      console.log(response);
    })
    .catch(function (error) {
      // handle error
      console.log(error);
    })
    .then(function () {
      // always executed
    });
})

Version

This library loads: Axios v0.19.2