import { ref } from 'vue';

function useRoleState() {
  const userRoleOrTemplate = ref();
  const roleReady = ref(false);

  function setUserRoleOrTemplate(newUserRoleOrTemplate) {
    userRoleOrTemplate.value = newUserRoleOrTemplate;
  }

  function markRoleReady() {
    roleReady.value = true;
  }

  return {
    userRoleOrTemplate,
    roleReady,
    setUserRoleOrTemplate,
    markRoleReady,
  };
}

const useRoleStateSingleton = useRoleState();

export {useRoleStateSingleton};

