-
#PureScript / #Halogen question, is there a way to compare HTML / VDom values for equality? I want to write some checks for some helper functions that have HTML results.
I started trying to write my own, but it sort of looks like I'd need to bind JS's (===) :: Foreign -> Foreign -> Boolean to deal with some of the internals.
Alternatively, how would you test
`flowTree :: forall a w i. (a -> HtmlTreeF w i a) -> a -> HTML w i`
given
```
newtype HtmlTreeF w i a = MkTreeF
{ rootContent :: Array (HTML w i)
, links :: Array (Tuple (Maybe (Array (HTML w i))) a)
}
``` -
Anyone using the brick #Haskell library and what to shore hints / lecture me about how to test functions that "live in" `EventM` ?
In particular, I'd like to be able to take an initial state (generated in whole or part randomly) feed some events (mainly keystrokes) in an then validate the final state. But, maybe I'm thinking about it all wrong.
The rendering functions are "easy enough" to test, but I feel like most of the real "logic" is in the event handling.
-
Is there a way to have #PureScript call DOM functions on #Halogen elements?
It _feels_ like re-rendering to VDOM would be wasteful, and there's already an event that will be triggered by my DOM calls.
In particular, I'd like like to use the existing browser/DOM state for a textarea (or some other form elements) rather than having to write a component that mimics what the browser is doing.
But, maybe I'm overthinking it, for now.