asProps. They both take an object of props.
asPropswon't be merged with previous values: to enable this behaviour, you need to set
toPropswill cause the wrapped component to re-render with the additional provided props. Let's see a very simple example where a prop
doubledValueis computed from a prop
asPropsis used exactly like
toProps, except that the provided props will be the only ones passed to the child component.
asPropsallow you to inject data into components, by using existing props or external data sources (sideways data loading).
component.fromEvent(name)), comes the ability to handle state: events are the source of truth, and state is a projection of these events.
connect) goes from actions to state to props (see Replacing react-redux connect HoC recipe). Refract can be used to bind together state from multiple sources.
component.useEvent(eventName)which returns a tuple containing the result of
pushEvent(eventName)(and the use of
startWithto ensure the
addOneprop is passed to the component on initial render).