title: vue mixin doing an axios call and setting data
body: <p>I have to hit an api and set the get some values from response and set it to the global mixin so that its avaialble to all components.. this is kind of an intialisation logic and api call has to run only one..</p>
  
  <pre><code>import Axios from 'axios'
  
  let updatetime
  function fetchData () {
    console.log('fetchData invoked')
    return Axios
      .get('https://api.coindesk.com/v1/bpi/currentprice.json')
      .then(response =&gt; {
        updatetime = response.data.time.updated
      })
  }
  fetchData().then(respons =&gt; { console.log('INSIDE---' + updatetime) })
  
  const myMixin = {
    data () {
      return {
        time: 'invalidTime'
      }
    },
    mounted () {
      console.log('old time' + this.time)
      this.time = updatetime
      console.log('new Time' + this.time )
    }
  }
  
  export default myMixin
  </code></pre>
  
  <p>I was hoping I can do a axios call outside [so that the axios doesnt run each time for a component] and set the value back to mixin.. I kind of want that axios call to be synchrnous since without this value other components wont work..</p>
  
  <p>But the mixin methods runs before the axios finishes..
  what is the right of doing this?</p>