Skip to content

Instantly share code, notes, and snippets.

View prince1456's full-sized avatar

Ali prince1456

  • Builddirect
  • Canada
  • 15:41 (UTC -07:00)
View GitHub Profile
@prince1456
prince1456 / service.js
Created July 3, 2021 06:42 — forked from paulsturgess/service.js
An example Service class wrapper for Axios
import axios from 'axios';
class Service {
constructor() {
let service = axios.create({
headers: {csrf: 'token'}
});
service.interceptors.response.use(this.handleSuccess, this.handleError);
this.service = service;
}