To put it simple, I am looking for a way to display a Behaviour (UI Element)
.
My actual use-case is displaying a table, which can be filtered. So I have a function tableElement :: String -> UI Element
(the String
parameter being the filter condition) and an input field filterElement :: Element
, which represents the filter. The most natural way for me to combine these would be something like this:
bFilter <- stepper "" (valueChange filterElement)
displaySomehow (fmap tableElement bFilter)
This is also the way it is done in Elm.
The closest thing I have found so far is using sink children
, but that works only with [Element]
and not with [UI Element]
. Additionally I have to use a dummy element as parent or fiddle around with the remaining children.
What would be the best way to to implement something like this with threepenny-gui?