How to use Pulse with Next.js
I’m trynna figure out what’s the best approach to use Prisma pulse with Next.js (app router), so I came up with this but im not sure if this is the right way to do it
My understanding is that this will:
My understanding is that this will:
- Set up a subscription when the page loads
- Listen for any changes to posts
- Revalidate the page when changes occur
- Show updated data to all users viewing the page
- Whether putting the subscription directly in the page component is optimal
- If there are any issues with connection management I should consider
- Whether I should handle the subscription in a route handler instead
- Or is there a better way to handle this overall
