DigitalRiver / react-atlas

Composable React components with CSS Modules.
http://digitalriver.github.io/react-atlas/
MIT License
38 stars 25 forks source link

Code review and refacator setOptions function in Dropdown. #897

Open hbowden opened 6 years ago

hbowden commented 6 years ago

Currently as written the setOptions function in Dropdown has 4 different functions declared and used within the setOptions function its self. The 4 anonymous function should be declared as named functions or named arrow functions outside of setOptions. This will make those functions pure instead of the current implementation that has variables in all functions in scope. When these functions are made pure they will be easier to read, maintain and test. I have a partial refactor I started at home that I can push up later.