uri-planetarium / interactive-planetarium-ERAU

0 stars 0 forks source link

The API requests from the component side have redundant code between components #18

Closed Shinkyuuu closed 2 years ago

Shinkyuuu commented 2 years ago

Both the JoinGame and WaitForGame (This host side also contains this issue) component have to make a get request from the API. Rather than having the same API request code appear in both components, it might be better to create a separate folder for all api requests and have the components pull the request code they need from it. This would DRYify our code.

Shinkyuuu commented 2 years ago

For now, I have decided to leave them as they are just in case we want to store socket.io connections within the request files as well. Should I combine the files that contain our fetch requests, placing socket.io connection code in there could make the said file convoluted. If we decide to keep socket.io connection code within the component file itself tho, then this issue could be reopenned.