Any feedback to improve efficiency with js is appreciated
Ismael Carrea
@Isma1306All comments
- @cwu90Submitted over 2 years ago@Isma1306Posted over 2 years ago
Great job, I like your code it is easy to read and follow. I could just tell you to add some logic to prevent the form to be submitted if you didn't select any rating. Right now if you just press submit you will get to the thanks page and it will say "You selected undefined out of 5" you can just wrap the logic inside the submitButtons callback function with an 'if (rating)' to prevent this behavior. Don't forget to leave outside the preventDefault!
Another good practice is using a IIFE to wrap your logic and prevent pollution, I will leave you the MDN doc to give you a good explanation https://developer.mozilla.org/en-US/docs/Glossary/IIFE . This is not necessary at all but it is a good idea to know about it.
I hope this help you, enjoy!
Marked as helpful1 - @loveforwebSubmitted over 2 years ago
Getting maps to update to a new location was somewhat tricky but managed to find a solution for it in the end.
It's not pixel perfect as I was using tailwind, also, as its not a client project I was a bit more relaxed with it.
Would be good to get some feedback on the project.
@Isma1306Posted over 2 years agoHey, I really like your solution, just one thing, you could easily handle domains requests too instead of only ips to make it a complete solution.
In the geoFetch.ts file inside the geoFetch function you could add an if / else statement and use it to separate ips from domains and do a different request to the API. Let me know if you need a hand.
Marked as helpful0