ToggleSwitch was originally written in such a way that it maintains state locally. rancher/dashboard#6751 recently introduced behavior to make the state reactive as well as introducing unit tests. With the tests in place, we should have more certainty in further refactoring.
In refactoring this component, we should
a. Remove all internal state management from ToggleSwitch.vue
b. Adhere to the principal of props down, events up
c. Remove the watcher for value
Prime example: within Rancher Desktop, this would help with hiding diagnostic checks if they don't apply in certain environments.
ToggleSwitch
was originally written in such a way that it maintains state locally. rancher/dashboard#6751 recently introduced behavior to make the state reactive as well as introducing unit tests. With the tests in place, we should have more certainty in further refactoring.In refactoring this component, we should
a. Remove all internal state management from
ToggleSwitch.vue
b. Adhere to the principal of props down, events up c. Remove the watcher forvalue
Prime example: within Rancher Desktop, this would help with hiding diagnostic checks if they don't apply in certain environments.