Thermite has the concept of sequencing Specs via the Semigroup instance, but sometimes you want to nest the markup of a Spec inside another. Lately I've been using this helper function:
wrap :: forall eff state props action.
Spec eff state props action ->
Spec eff state props action ->
Spec eff state props action
wrap parent child = simpleSpec pa rn
where
pa a p st k = do
view _performAction parent a p st k
view _performAction child a p st k
rn k p st children = view _render parent k p st (view _render child k p st children)
At this point, I'm not sure whether this re-appropriation of the children argument is elegant or hacky. Does it make sense to add a function like this to Thermite? I'm definitely open to better names as well.
Thermite has the concept of sequencing
Specs via theSemigroupinstance, but sometimes you want to nest the markup of aSpecinside another. Lately I've been using this helper function:At this point, I'm not sure whether this re-appropriation of the children argument is elegant or hacky. Does it make sense to add a function like this to Thermite? I'm definitely open to better names as well.