Skip to content

Instantly share code, notes, and snippets.

View kayvazov's full-sized avatar
🌎
Working from home

Kenan Ayvazov kayvazov

🌎
Working from home
View GitHub Profile

Hi My name is Kenan Ayvazov

Frontend develop in Freedom Finance Tech

  • 🌍  I'm based in Cyprus, Limassol
  • ✉️  You can contact me at kep4408@gmail.com### Skills

@kayvazov
kayvazov / asyncData.js
Last active April 29, 2020 05:32
asyncData.js for Vue ( without Nuxt.js )
// asyncData.js
export default ({ store, router }) => async (to, from, next) => {
const matched = router.getMatchedComponents(to);
const prevMatched = router.getMatchedComponents(from);
let diffed = false;
const activated = matched.filter((c, i) => {
const isActivated = diffed || (diffed = (prevMatched[i] !== c));
return isActivated;
});