Regarding api calls in created vs mounted , I haven’t experienced any speed difference for putting fetch calls there. I’m curious , hav suoi and if so - would you mind sharing the scenario?
Another thought that might matter to some ... SSR doesn’t have mounted - so that would be a good reason to use created (if SSR matters to you)
Sorry, I didn't mean to imply that is was actually faster, but that is it user perceived faster. Since the API call is kicked off before the component is rendered, it will already be in progress for when the component is shown on the screen and the user's perception of the loading time is started. This would then cut down on the perceived wait time that the user has to endure before interacting with your component. I'll update the article to reflect this.
And that's an interesting note Server-Side Rendering. Thank you for that.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Thanks for the article.
Regarding api calls in created vs mounted , I haven’t experienced any speed difference for putting fetch calls there. I’m curious , hav suoi and if so - would you mind sharing the scenario?
Another thought that might matter to some ... SSR doesn’t have mounted - so that would be a good reason to use created (if SSR matters to you)
Sorry, I didn't mean to imply that is was actually faster, but that is it user perceived faster. Since the API call is kicked off before the component is rendered, it will already be in progress for when the component is shown on the screen and the user's perception of the loading time is started. This would then cut down on the perceived wait time that the user has to endure before interacting with your component. I'll update the article to reflect this.
And that's an interesting note Server-Side Rendering. Thank you for that.