Skip to content

Instantly share code, notes, and snippets.

View kholiavko-roman's full-sized avatar
🇺🇦

Kholiavko Roman kholiavko-roman

🇺🇦
View GitHub Profile
@mariocesar
mariocesar / api.js
Created September 26, 2017 04:21
Axios single configured instance
import axios from "axios";
const singleton = Symbol();
const singletonEnforcer = Symbol();
function readCookie(name) {
const match = document.cookie.match(new RegExp('(^|;\\s*)(' + name + ')=([^;]*)'));
return (match ? decodeURIComponent(match[3]) : null);
}