<template>
  <div>
    <h1>Hello {{ this.currentUser }}</h1>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
export default {
  async mounted() {
    await this.$store.dispatch("fetchUser");
  },
  computed: {
    ...mapGetters({ currentUser: "userEmail" })
  },
  methods: {
    getUser() {
      try {
        return this.$store.getters.userEmail;
      } catch (TypeError) {
        // pass}
      }
    }
  }
};
</script>

<style lang="scss" scoped></style>
