I have created a toggle switch in ELM but I want to use JSON.decode such that if the toggle button is ON, the Json indicates it such that { toggle: ON} and similarly if its OFF. Also, I have mentioned the default toggle as ON (onClick) but it doesn’t seem to be ON. How can I achieve this?
It is good practice if the view is always derived from the model (instead of using the inherited stated from the DOM), meaning that the checked status should be controlled by Elm.