3 Replies
I read a few articles and watched some videos... and used the heck out chat GPT and this is what I came up with for a repository pattern base class, a class that endpoint specific classes can inherit ... like-this
I was hoping if someone had experience implementing a repository pattern in nuxt might give me some feedback on this before I run with it... see any future set backs with using this?
I also made a plugin like this
If any of you have a more simple solution I would love to hear it
You probably saw this already?
https://youtu.be/jXH8Tr-exhI?si=DByKiCmManO3kiVF
Alexander Lichter
YouTube
Custom $fetch and Repository Pattern in Nuxt 3
💻 The repository pattern is a popular way to abstract your API calls away and provide a descriptive way to retrieve or send data. But how would you implement it in Nuxt? And should you use composables or $fetch for it? This video will give answers to all the questions!
Key points:
🎛️ Implementing the repository pattern in Nuxt
🔛 Creating our ow...
I did, It was a great video. I used a lot of the logic in this video, along with a couple of articles like - https://medium.com/@luizzappa/nuxt-3-repository-pattern-organising-and-managing-your-calls-to-apis-with-typescript-acd563a4e046
Medium
Nuxt 3 | Repository pattern: organising and managing your calls to ...
In Nuxt 2 the use of axios was straightforward and allowed a good management of API calls. When I started to develop with Nuxt 3 I found it…