Sha256: f9ca223e0eca427137b0367c87cdb7d387dc1eecb24036194a626048f0243ec2

Contents?: true

Size: 501 Bytes

Versions: 51

Compression:

Stored size: 501 Bytes

Contents

require 'opal'
require 'jquery'
require 'opal-jquery'
require 'opal-haml'
require 'vienna'
require "react"

require 'models/todo'

require "components/app.react"

Document.ready? do
  element = React.create_element(TodoAppView, filter: "all")
  component = React.render(element, Element.find('#todoapp').get(0))

  Vienna::Router.new.tap do |router|
    router.route('/:filter') do |params|
      component.set_props(filter: params[:filter].empty? ? "all" : params[:filter])
    end
  end.update

end

Version data entries

51 entries across 51 versions & 3 rubygems

Version Path
reactrb-0.8.8 example/todos/app/application.rb
reactrb-0.8.7 example/todos/app/application.rb
reactrb-0.8.6 example/todos/app/application.rb
reactrb-0.8.5 example/todos/app/application.rb
reactrb-0.8.4 example/todos/app/application.rb
reactrb-0.8.3 example/todos/app/application.rb
reactrb-0.8.1 example/todos/app/application.rb
reactrb-0.8.0 example/todos/app/application.rb
reactrb-0.7.42 example/todos/app/application.rb
reactive-ruby-0.7.41 example/todos/app/application.rb
reactive-ruby-0.7.40 example/todos/app/application.rb
reactive-ruby-0.7.39 example/todos/app/application.rb
reactive-ruby-0.7.38 example/todos/app/application.rb
reactive-ruby-0.7.36 example/todos/app/application.rb
reactive-ruby-0.7.35 example/todos/app/application.rb
reactive-ruby-0.7.34 example/todos/app/application.rb
reactive-ruby-0.7.33 example/todos/app/application.rb
reactive-ruby-0.7.32 example/todos/app/application.rb
reactive-ruby-0.7.31 example/todos/app/application.rb
reactive-ruby-0.7.30 example/todos/app/application.rb