Created
March 15, 2017 12:13
-
-
Save mazikwyry/fde05ab38f18f35742a6384866a261c5 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
require 'opal' | |
require 'jquery' | |
require 'opal-jquery' | |
require 'json' | |
require 'react-latest' | |
require 'reactrb' | |
require 'todo' | |
require 'todo_store' | |
require 'components/todo_box' | |
require 'components/todo_form' | |
require 'components/todo_element' | |
$store = ToDoStore.new([]) | |
render = lambda do | |
Element['#content'].render { ToDoBox(todos: $store.state) } | |
end | |
Document.ready? do | |
$store.subscribe(&render) | |
render.call | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment