You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Comment by MangelMaxime Friday Jan 11, 2019 at 08:41 GMT
I tried to extract them to a module but I couldn't find a way to write it in a type safe way.
In F# record can't inherit from another so I can't be sure that the State provide by the user got Validators property. I could use JavaScript interop using ? operator but I am not sure yet.
Comment by MangelMaxime Friday Jan 11, 2019 at 10:43 GMT
Perhaps, I don't really know :)
I am sure the state can't be a Class otherwise elmish debugger or console log would not work. As it's using Thoth.Json to generate the JSON and because classes can't be converted by default due to limitation in Fable reflection.
We can test using an interface and see if this don't had too much noise/code duplication etc. And also, if we can pass F# type system when using interface to represent the state :)
I mean today we are boxing the field state in order to store all the field states in a single list. source code
Issue by nojaf
Friday Jan 11, 2019 at 07:29 GMT
Originally opened as MangelMaxime/Thoth#120
Looking at Select, RadioButton and Textarea.
They all have the same
let private validate
andlet private isValid
.Perhaps some functions could be extracted and added to a module for easy re-use?
The text was updated successfully, but these errors were encountered: