Last active
May 23, 2019 00:31
-
-
Save bradfordlemley/d2ebe65b156960640a66ea59ce21c26b to your computer and use it in GitHub Desktop.
React component invoking functionality object methods
This file contains 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 { appState$, todoLib } from './state'; | |
const App = ({todos, counter, total}) => | |
<> | |
<button onClick={() => todoLib.addTodo("New todo")}> | |
Add Todo | |
</button> | |
<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