import Cookies from 'js-cookie'
import Vue from 'vue'

const cookies = {
    setData: (key, value) => {
        console.log("setData -  key:" + key + "  value:" + JSON.stringify(value));
        Cookies.set(key, JSON.stringify(value));
    },

    getData: (key) => {
        console.log("getData -  key:" + key);
        return key && Cookies.get(key) && JSON.parse(Cookies.get(key));
    },

    removeData: (key) => {
        console.log("remove -  key:" + key);
        Cookies.remove(key);
    }
}

Vue.prototype.$cookies = cookies;

export default cookies;
