import { defineStore } from 'pinia'

export const useUserStore = defineStore('user', () => {
  const username = ref('')
  const config = ref<{ port?: string }>({})

  function setUserName (name: string, p?: string) {
    username.value = name
  }
  function setUserConfig (name: string, obj: Object) {
    config.value = obj
    username.value = name
  }

  return { username, config, setUserName, setUserConfig }
})