Skip to content

Instantly share code, notes, and snippets.

@bradfordlemley
Last active May 23, 2019 00:29
Show Gist options
  • Save bradfordlemley/575e5f8122a921d359df6e07b1584ade to your computer and use it in GitHub Desktop.
Save bradfordlemley/575e5f8122a921d359df6e07b1584ade to your computer and use it in GitHub Desktop.
React component using observable state via connect binding
import { appState$ } from './state';
const App = ({todos, counter, total}) =>
<>
<div>counter: {counter}</div>
<div>todos: {todos.map(todo => <div>{todo.title}</div>)}</div>
<div>total: {total}</div>
</>
export default connect(appState$)(App);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment