Skip to content

Instantly share code, notes, and snippets.

@Mattchewone
Created December 6, 2018 23:31
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 Mattchewone/cf6de6ca7b4c5329d57b8d52cd9da150 to your computer and use it in GitHub Desktop.
Save Mattchewone/cf6de6ca7b4c5329d57b8d52cd9da150 to your computer and use it in GitHub Desktop.
Reading data from the vuex store
export default {
computed: {
...mapGetters('messages', {
findMessagesInStore: 'find'
})
},
messages () {
const user = this.$store.state.auth.user
return this.findMessagesInStore({ query: { $or: [{ to: user._id }, { from: user._id }] } }).data
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment