nerves-keyboard / xebow

Firmware for the Keybow written in Elixir
40 stars 10 forks source link

Refactor config value casting #70

Closed doughsay closed 4 years ago

doughsay commented 4 years ago

Originally I had the phoenix live-view responsible for casting values coming from the client, strictly requiring that all values were correct before being passed in to Config.update. This is obviously not that great... it would be much nicer if Config.update returned either :ok, or {:error, :cast_error} or something like that. This would be a nicer developer experience. As of right now, it will crash with a pattern match error, which is not ideal.