-
Notifications
You must be signed in to change notification settings - Fork 9
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
Define the .siblingAfter, .siblingBefore, .child and .parent helpers #19
Comments
For example, using this would look like: const Header = props =>
<header>
{children}
</header>
const Title = ({title}) => <h1>{title}</h1>
export default compose(
withChildren(({title}) => ({title})(Title)
)(Header)
const Subtitle = ... …and in React Dream const HeaderContents = Title
.siblingAfter()
.ap(Subtitle)
Header
.children(({title}) => ({title}))
.ap(HeaderContents) ping @deepsweet |
Composing components like this would lead to the ability to bimap and bicontramap. With that, props could be filtered for any of the inner components. This will mean we will assume any component to be always a composition of other two components. In the case of a component without a second component, it would be the identity component. In an use case: const Header = Html.H1
.parent(Html.Header)
.bicontramap(
({title}) => ({children: title}),
({hovered}) => ({style: {background: 'red'}})
) The question then would be, is this |
Possibly the answer is that a component is a structure with more complexity inside:
This would make the If this internal representation is kept separated, then it is possible to make bicontramap or map on children. I wonder what the impact in the React tree in the DevTools would be. |
From the higher-order components:
The text was updated successfully, but these errors were encountered: