Sha256: 8e5bd1f8b2ddccb6b45c49cd4b0d85677b953dee42acb4664b75fdf8821b07b2

Contents?: true

Size: 626 Bytes

Versions: 13

Compression:

Stored size: 626 Bytes

Contents

class Hello < Hyperloop::Component

  state time: Time.now

  after_mount do
    every(1) { mutate.time Time.now }
  end

  render(DIV) do
    DIV { "Hello! The time is #{state.time}." }
    DIV { INPUT(id: :message1); BUTTON { "send"}
    .on(:click) { SendToAll(message: Element['#message1'].value) } }
    DIV { INPUT(id: :message2); BUTTON { "send2"}
    .on(:click) { Operations::NestedSendToAll(message: Element['#message2'].value) } }
    if Messages.all.count == 0
      DIV { "No Messages" }
    else
      UL do
        Messages.all.each do |message|
          LI { message }
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hyper-operation-0.5.12 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.11 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.10 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.9 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.8 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.7 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.6 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.5 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.4 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.3 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.2 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.1 examples/smoke_test/app/hyperloop/components/hello.rb
hyper-operation-0.5.0 examples/smoke_test/app/hyperloop/components/hello.rb