absent-sapphire
absent-sapphire13mo ago

socket.io

Hi, how can I add socket.io to my project to use with liveProvider?
9 Replies
kapa.ai
kapa.ai13mo ago
Hi @RomaY. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
kapa.ai
kapa.ai13mo ago
---------------------- Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the liveProvider documentation (https://refine.dev/docs/api-reference/core/providers/live-provider/) for more information on how to create a custom liveProvider for your project. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai13mo ago
<@538717491908575242> kapa.ai is still learning and improving, please let us how it did by reacting below
absent-sapphire
absent-sapphire13mo ago
And how do I set it up so that I can freely use it throughout the project? Do the standard methods from its documentation work for me with socket.io? Hello, who can help me? I'm using useInfinitelist to download messages and want to add new ones to the list when I send it using socket.io
xenial-black
xenial-black13mo ago
Hello @RomaY, sorry for the late response. Could you check our other live provider examples and let us know if they are helpful to you? https://refine.dev/docs/api-reference/core/providers/live-provider/
absent-sapphire
absent-sapphire13mo ago
But I want to use useInfiniteList with socket.io, how can I update my data? I don't want to use other methods for liveProvider, I just need how do I overwrite my data with useInfiniteList when I get new data from socket.io I already figured out how to do it
xenial-black
xenial-black13mo ago
That's great to hear @RomaY , would you like to share how you did it for future reference? It may be useful for other people!
absent-sapphire
absent-sapphire12mo ago
I just made a state for my infinite list, then when I get a new element through the socket, I just go through the map method on my pages, and add where the page index is 0
xenial-black
xenial-black12mo ago
Thanks!