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.
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.