import { useState } from './useState'; export function useRole() { function hasAny(roles) { const { getRoles } = useState(); const roleStore = getRoles(); for (const role of roles) { if (roleStore.value.indexOf(role) !== -1) return true; } return false; } return { hasAny, }; }