Introduction
Make a local store to keep data on the client. The store will be global and will reflect changes to all.
How to use with Vue prototype
// main.js
import { createStore } from "lib/utils/hhl-localStore";
import Vue from "vue";
const _states = {
count: 1,
darkTheme: true
};
const localStore = createStore("store", _states)
Vue.prototype.$store = localStore.store
How to use it as a global you can import.
// myStore.js.
import { createStore } from "lib/utils/hhl-localStore";
import Vue from "vue";
const _states = {
count: 1,
darkTheme: true
};
export const localStore = createStore("store", _states).store;
← Date Functions Fetch →