I need to check if an object coming from vuex is empty in my Vue component
My component script:
<script>
import { createNamespacedHelpers } from 'vuex'
const { mapState } = createNamespacedHelpers('payments')
export default {
    methods: {
        ...mapState(['bankData']),
        request () {
            if (this.bankData) { //How can I do this condition? 'if (this.bankData)'
                return this.$router.push({ name: 'payment.request' })
            }
            this.$root.$emit('openModal')
        }
    }
}
</script>
The call of my module:
export default new Vuex.Store({
    modules: {
        payments
    }
})
My state in store:
state: () => ({
    bankData: {}
}),
When i do console.log(this.bankData) i receive:
ƒ mappedState () {
      var state = this.$store.state;
      var getters = this.$store.getters;
      if (namespace) {
        var module = getModuleByNamespace(this.$store, 'mapState', namespace);
  …
 
    