Skip to content

Instantly share code, notes, and snippets.

View hayoung-jeremy's full-sized avatar

Ha young, Kim hayoung-jeremy

View GitHub Profile
@paulsturgess
paulsturgess / service.js
Last active February 2, 2024 17:24
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;
}