0

I have a VUE JS 2 app with quite a lot of api calls and images in masonry.

When i open a page, all fetch request start and if i switch view, through a router-link:

  <router-link :to="'/user/'+artistInfos.user_addr+'/collection'" @click.native="resetArtistScroll()" exact tag="li" :class="{active: $route.name == 'user-collection'}">
    COLLECTION
  </router-link>

it load a different content/component into the area where the initial content was called.

Problem i face is all previous fetch calls keep going and delay the calls of the new content.

Is there a way to clear all this in the view before loading the new content?

Christophe
  • 145
  • 1
  • 1
  • 12
  • 1
    Here another topic about abort fetch request: https://stackoverflow.com/questions/31061838/how-do-i-cancel-an-http-fetch-request – ZecKa Mar 09 '21 at 10:51
  • Thank you, i tested it with the abort in beforeDestroy and this work well for the api call. Will see what can be done to abort all the images to continue download as well when changing view then. – Christophe Mar 09 '21 at 11:31

0 Answers0