DEV Community

Discussion on: Vuexfire : How to implement using simple Vue Notes Applicaiton

Collapse
 
brianyamasaki profile image
Brian Yamasaki

I have a suggestion for your App.vue so you don't have to import the store. Use mapGetters and mapActions instead.

import { mapGetters, mapActions } from 'vuex';

export default {
name: 'Notes' ,
methods: {
...mapGetters(['getNotes']),
...mapActions(['bindNotes']),
},
computed: {
Notes() {
return this.getNotes();
}
},
created() {
this.bindNotes();
}
}

Implement getNotes to simply return this.notes in your index.js

Thanks for making this. It helped me figure things out.