Code was creating a new socket connection every time the CodeEditor component is mounted.
Now, the socket connection is created only once and reused. I've used a ref to store the socket instance and only create the connection if it doesn't already exist.
it was mentioned before in #13 that this was happening and while I was using it locally, Cloudflare was up to 35k requests in a short amount of time.
Code was creating a new socket connection every time the CodeEditor component is mounted.
Now, the socket connection is created only once and reused. I've used a ref to store the socket instance and only create the connection if it doesn't already exist.
it was mentioned before in #13 that this was happening and while I was using it locally, Cloudflare was up to 35k requests in a short amount of time.
I also added a debounce function for the editor.