Re:A list of companies using Elm in production
by loganmac on Wednesday February 05, 2020 @01:28PM
(#22249652)
Iād really like to understand more of this. Any chance you could make an Ellie or something to demonstrate?
[ Parent
| on HN ]
Re:A list of companies using Elm in production
by antew on Wednesday February 05, 2020 @04:22PM
(#22251112)
I don't have one on Ellie, but Ellie itself has a nice example with how it wraps CodeMirror (https://github.com/ellie-app/ellie/blob/master/assets/src/El...)
I don't know if there is a formal name for this pattern, but we've been calling in the "un-attr" pattern, you define an opaque type like
type Attribute msg
= Attr (Html.Attribute msg)
And then expose functions that allow you to set attributes you whitelist. In the JS you use setters to hook into when the attribute changes and respond to it (https://github.com/ellie-app/ellie/blob/master/assets/src/El...)