-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nesting Specs #54
Comments
Hmm, that's interesting. I expected users would pass a I think the name |
Another question is: should the children be passed as a singleton array? Or even pass an array of child |
This is what I came up with:
Furthermore, what would props be used for in Thermite? When using focused specs there's only one global state anyway, or am I missing something? |
I'm not sure how useful that would be, but if |
@pkamenarsky I think focusing would use a separate call to Props are used at the top-level when the full component is integrated into a larger React application. I'm interested in the |
@paf31 Yes, focusing is a separate call (i.e.
without having to call re props - so if the whole application is written in Thermite, props are basically useless? |
Pretty much, on the |
I have an almost identical function nestSpec :: forall eff state props action. T.Spec eff state props action -> T.Spec eff state props action -> T.Spec eff state props action
nestSpec parent child = T.simpleSpec performAction render
where
performAction a p st = do
view T._performAction parent a p st
view T._performAction child a p st
render k p st children = view T._render parent k p st (view T._render child k p st children) Would you be open for a PR? |
Thermite has the concept of sequencing
Spec
s via theSemigroup
instance, but sometimes you want to nest the markup of aSpec
inside 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.
The text was updated successfully, but these errors were encountered: