Closed MareikeFla closed 6 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
community-app | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Mar 19, 2024 6:07pm |
Thanks! This was a lot of fun and I am so happy it worked out like I wanted it to be!
This DS goal was it to improve our data fetching. To do so, I first analyzed where we fetch what and then created a plan to improve fetching.
Analyze where we fetch
Event/s
useSWR
fetch()
Categories (all useSWR)
Other
Plan
Having a context that provides:
A. Data
use useSWR to fetch:
[x] all categories
[x] all events
B. Functions
Functions using the context data:
Functions not using the context data:
[x] use useSWR to fetch an event and its comments by id
Functions mutateing the context data:
[x] create a new event
[x] update an Event
[x] delete an event
[x] Add a comment
Goal
All data fetching is centralized in our data context.