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