DEV Community

Discussion on: Quick Vue Tip: Cleaner Data Fetching

Collapse
pholly profile image
Philip Holly

Thanks for this. For routing params, I made them component props and watch the props. I found this article because I wanted to confirm if it's good practice to fetch data in just the watcher and not in created as well. Makes sense to do it in just the watcher using immediate, unless other setup needs to be done when the component is created before making the api call.

Collapse
mccabiles profile image
Miguel Author

Happy to hear it helped!