xenial-black
xenial-black15mo ago

socket.io

Hi, how can I add socket.io to my project to use with liveProvider?
9 Replies
kapa.ai
kapa.ai15mo 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.ai15mo 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.ai15mo ago
<@538717491908575242> kapa.ai is still learning and improving, please let us how it did by reacting below
xenial-black
xenial-black15mo 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
like-gold
like-gold15mo 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/
xenial-black
xenial-black15mo 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
like-gold
like-gold15mo 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!
xenial-black
xenial-black14mo 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
like-gold
like-gold14mo ago
Thanks!