test_1
test_113mo ago

call socket.io events from inside trpc endpoints?

how do i implement notifications when someone likes a post with socket.io? will every user have his own socket.io room and then when someone likes their post that someone joins their room to send websocket? and what if user is offline i dont want any websocket event also how do i have my server broadcast a websocket inside the trpc route itself instead of having the frontend send both a fetch and emitting a socket event? since socket.io is inside a function io.on and its seperate from my trpc endpoints idk how to emit stuff from the endpoints
1 Reply
Albastru
Albastru13mo ago
do you have any examples of how your socket.io is currently setup?