mikesol / purescript-deku

A PureScript web UI framework
https://purescript-deku.surge.sh/
Apache License 2.0
123 stars 12 forks source link

How to structure this common pattern #117

Open jerbaroo opened 5 months ago

jerbaroo commented 5 months ago

How to use this component foo in a parent that has a Poll (Maybe String) ?

foo :: Poll String -> AppM
jerbaroo commented 5 months ago

One way would be to filter the Poll (Maybe String) in the parent into a Poll (String). However that would simply result in any Nothings causing foo to render the last Just String in the stream of Maybes.

I am more interested in, given Foo, how we can acquire something of the lines of Poll (Maybe String) -> AppM. Thanks.

mikesol commented 4 months ago

I'll come up with an example in a few days, thanks for asking this!

mikesol commented 2 weeks ago

Sorry, getting back to this now (it's been a crazy few months, I'm only now getting back to Deku). Rereading this, I don't quite understand the example. Could you give me a bit more context (if it's still relevant)?