title: What is the best way to use async / await inside Nuxt plugin?
body: <p>I wanted to do api calls inside nuxt plugin using vuex action. But when i am using await keyword Nuxt is giving me an error saying <code>Parsing error: Unexpected reserved word 'await'.</code> So, how can i use promise inside my Nuxt Plugin? Here's my associated code -&gt;</p>
  <pre><code>export default (context) =&gt; async({ store, route, redirect }) =&gt; {
    const address = store.state.location.selectedAddress
    const payload = {}
  
    if (!address) {
      navigator.geolocation.getCurrentPosition(
        (position) =&gt; {
          payload.latitude = position.coords.latitude
          payload.longitude = position.coords.longitude
          const result = await store.dispatch('location/fetchLocation', payload)
          console.log(result)
          console.log(
            store.state.location.details &amp;&amp; store.state.location.details.address
          )
        },
        (error) =&gt; {
          console.log(error.message)
        }
      )
    }
  }
  
  </code></pre>