L
L
Luke LikeSkywalker2018-10-01 12:45:01
Vue.js
Luke LikeSkywalker, 2018-10-01 12:45:01

With the Geolocation API, the computer starts to slow down. Perhaps due to Vue?

In the App.vue file, the geolocation API is running during the created hook. After a while of running the application, the computer starts to slow down. I think that while the application is running, during the created hook, the geolocation process starts all the time and loads the computer. Is this possible, if so, how to solve the problem?

created() {
    // Getting geolocation with GeoLocation API
    this.$getLocation()
    .then(coordinates => {
      this.$store.commit("SET_LOCATION", coordinates);
      this.$store.dispatch("getWeatherData");
    })
    .catch(function(error) {
      console.log(error);
      this.$store.dispatch("updateWeatherData", "New York");
    });
  }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question