Skip to content

Instantly share code, notes, and snippets.

@mazikwyry
Created March 15, 2017 12:13
Show Gist options
  • Save mazikwyry/fde05ab38f18f35742a6384866a261c5 to your computer and use it in GitHub Desktop.
Save mazikwyry/fde05ab38f18f35742a6384866a261c5 to your computer and use it in GitHub Desktop.
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