f / vue-wait

Complex Loader and Progress Management for Vue/Vuex and Nuxt Applications
MIT License
2k stars 101 forks source link

Add integration with nuxt asyncData/fetch #86

Open Kolobok12309 opened 4 years ago

Kolobok12309 commented 4 years ago

Mb for nuxt asyncData api, because waitFor not working for this Something like this

export default function (waiter, func) {
  return async (...args) => {
    const { app } = args[0];

    try {
      app.wait.start(waiter);
      return await func.apply(this, args);
    } finally {
      app.wait.end(waiter);
    }
  };
};

Or if vue-wait have this function, sorry and help pls)