import { reactive } from 'vue';

export const store = reactive<{token: string | null, setToken: (token: string | null) => void}>({
  token: localStorage.getItem('token') || null,
  setToken: (token: string | null) => {
    store.token = token
    if (token) {
      localStorage.setItem('token', token)
    } else{
      localStorage.removeItem('token')
    }
  }
});


