Last active
March 16, 2017 09:49
-
-
Save couzic/71f27119b8d2ac85dcd149eb8f13e754 to your computer and use it in GitHub Desktop.
react-rx-pure-connect Simple Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import {connect} from 'react-rx-pure-connect' | |
| const name$ = Observable.of('Bob') | |
| const Component = (props: {name: string}) => <h2>Name: {props.name}</h2> | |
| const mapProps = () => name$.map(name => ({name})) | |
| const Name = connect(mapProps)(Component) | |
| // Rendered as "<h2>Name: Bob</h2>" | |
| <Name /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment