ExpressLRS / web-flasher

Web-hosted flasher for ExpressLRS version 3 firmware
22 stars 15 forks source link

Improve Readability #11

Closed justinlampley closed 1 year ago

justinlampley commented 1 year ago

Improve readability by using await instead of promise chaining and also using string templates.

pkendall64 commented 1 year ago

Thanks Justin. I wasn't sure what the preferred way of working with promises was in Javascript. I'll make sure it all works and merge if it's ok.

justinlampley commented 1 year ago

I see it as more of a personal preference than anything else. I was perusing the code to see what I could "borrow" for the configurator and was trying to understand all the magic you were working and began converting sections to async-await since it is easier for me to follow than promise chaining. Once I started, I ended up converting most of it over and figured I might as well make a PR with the changes, but no need to include it if you don't think it improves the readability.

pkendall64 commented 1 year ago

I see it as more of a personal preference than anything else. I was perusing the code to see what I could "borrow" for the configurator and was trying to understand all the magic you were working and began converting sections to async-await since it is easier for me to follow than promise chaining. Once I started, I ended up converting most of it over and figured I might as well make a PR with the changes, but no need to include it if you don't think it improves the readability.

You can "borrow" as much stuff as you require for Configurator 😄 This project is more of a test platform to prove the concept than anything else.