Last active
March 15, 2017 11:26
-
-
Save mazikwyry/8880f972be4eda8764e117e00985787c to your computer and use it in GitHub Desktop.
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
class ToDoBox < React::Component::Base | |
param :todos, type: Array | |
def add_todo(body) | |
$store.dispatch({ | |
type: :add_todo, | |
id: 1, | |
body: body | |
}) | |
end | |
render do | |
div do | |
h1 { 'Dreams to fulfill' } | |
ToDoList(todos: todos) | |
ToDoForm(add_todo: lambda { |body| add_todo(body) }) #Method Object | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment