Skip to content

Instantly share code, notes, and snippets.

@couzic
Last active March 16, 2017 09:49
Show Gist options
  • Select an option

  • Save couzic/71f27119b8d2ac85dcd149eb8f13e754 to your computer and use it in GitHub Desktop.

Select an option

Save couzic/71f27119b8d2ac85dcd149eb8f13e754 to your computer and use it in GitHub Desktop.
react-rx-pure-connect Simple Example
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