Skip to content

Instantly share code, notes, and snippets.

@neodigm
Last active July 2, 2021 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save neodigm/74234859cbc5dbb9f7a889fb7971e560 to your computer and use it in GitHub Desktop.
Save neodigm/74234859cbc5dbb9f7a889fb7971e560 to your computer and use it in GitHub Desktop.
// Dive into DOM to access Vuex array from mixin
export function getFeatureDOM(feature) {
// Return Feature Flag if it exists for current user
const features = document.querySelector('DIV#app').__vue__.$store.state.auth
.currentUser.activeFeatures
return features ? features.filter((fe) => fe === feature)[0] : null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment