Element.explain
mdgriffith/elm-uiのデバッグ用のAttribute
https://gyazo.com/8d7f502eea02fb377b7e6eeace5f336b
explainを付けた要素自体は茶色枠、その直接の子要素は緑の破線枠になる
型
code:Elm
explain : Todo -> Attribute msg
type alias ToDo = String -> Never
使い方
code:Elm
el
[ Element.explain Debug.todo
]
(text "Help! I'm being debugged!")
Never
Neverは値を作れない型です
Debug.todo : String -> aなのでこれで受けれます。Elmにはこれしかa出す関数ないのでこれでしか受けれません
つまりexplain使うときは必ずDebugが入るのでoptimizeのときに検知されて消し忘れ予防になります
あたまいい