the-dr-lazy / purescript-monarch

A simple but powerful PureScript library for declaring pure UIs
Mozilla Public License 2.0
9 stars 0 forks source link

Make virtual DOM API uniform #41

Closed the-dr-lazy closed 2 years ago

the-dr-lazy commented 3 years ago

Well, personally as the writer of div, div_, div' functions, I can't remember which one was which! Let's keep it simple, stupid. :)

the-dr-lazy commented 2 years ago

I've changed my mind about the virtual DOM API. @jedimahdi proposed to me the following API a while ago:

view model =
    div { children: [ button { onClick: const UserClickedDecreaseButton
                             , children: [text "-"]
                             }
                    , text $ show model
                    , button { onClick: const UserClickedIncreaseButton
                             , children: [ text "+" ]
                             }
                    ]
        }

I'm going to try it.