Sha256: 7e9f96ea76daf44575f57861adb5291670a3646255f922840b2fe3792eadefa0

Contents?: true

Size: 621 Bytes

Versions: 5

Compression:

Stored size: 621 Bytes

Contents

require 'user'
require 'hyper-mesh'

class TodosComponent

  include React::Component

  export_component

  #optional_param :initial_user_email
  required_param :users, type: [User]
  #define_state :users

  before_mount do
    # `debugger`
    nil
    #users! [User.find_by_id(1), User.find_by_id(2), User.find_by_id(3)]
  end

  after_mount do
    #puts "after mount"
    # `debugger`
    nil
  end

  backtrace :on

  after_update do
    #puts "after update"
    if user
      #  `debugger`
      nil
    end
  end

  def render
    div do
      TodosMainComponent(users: users)
    end.hide_while_loading
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
hyper-mesh-0.5.3 reactive_record_test_app/app/assets/javascripts/components/todos_component.js.rb
hyper-mesh-0.5.2 reactive_record_test_app/app/assets/javascripts/components/todos_component.js.rb
hyper-mesh-0.5.1 reactive_record_test_app/app/assets/javascripts/components/todos_component.js.rb
hyper-mesh-0.5.0 reactive_record_test_app/app/assets/javascripts/components/todos_component.js.rb
hyper-mesh-0.4.0 reactive_record_test_app/app/assets/javascripts/components/todos_component.js.rb