restaumatic/purescript-specular

[RFC] Remove `Specular.Dom.Widgets` from the main repo

Opened this issue · 2 comments

zyla commented

Looking at the APIs there:

buttonOnClick :: forall m. MonadWidget m => WeakDynamic Attrs -> m Unit -> m (Event Unit)

checkbox :: forall m. MonadWidget m => Boolean -> Attrs -> m (Dynamic Boolean)
checkboxView :: forall m. MonadWidget m => WeakDynamic Boolean -> WeakDynamic Attrs -> m (Event Boolean)

textInput :: forall m. MonadWidget m => TextInputConfig -> m TextInput
textInputOnChange :: forall m. MonadWidget m => String -> Attrs -> m (Dynamic String)
textInputOnInput :: forall m. MonadWidget m => String -> Attrs -> m (Dynamic String)
textareaOnChange :: forall m. MonadWidget m => String -> Attrs -> m (Dynamic String)

They are very inconsistent. Sometimes take static attributes, sometimes dynamic.

In practice I often end up writing alternate versions of them.

Maybe it would be wiser to keep them out of the main repo, and only expose:

  • facilities for binding to DOM events of DOM nodes
  • (maybe) facilities for binding to value of DOM nodes

@dktn @przembot Opinions?

(maybe) facilities for binding to value of DOM nodes

That would correspond to some event changed of DOM node?

Overall, maybe yes, but it would end up writing some commons every time and sticking to them.
What kind of facilities can you think of?

zyla commented

Related: #33