Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Is this a good practice? [Fetching data in beforeRouterEnter]
Author Summary
Post Body

So, I'm a bit new to Vue. I can code, I can understand, but I'm not too immersed in usual practices. I've come across a project that used this to fetch data. Is this a good practice? Yes, no, why?

 private beforeRouteEnter(to: Route, from: Route, next: any) {
    next(async wm => {
      api.getDashStats().then(resp => {
        wm.counts = resp;
      });
      wm.filters = await api.fetchFilters();
    });
  }

used: Typescript and vue-property-decorator.

Author
Account Strength
100%
Account Age
5 years
Verified Email
Yes
Verified Flair
No
Total Karma
19,620
Link Karma
7,928
Comment Karma
11,539
Profile updated: 1 day ago
Posts updated: 4 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago