Debugging
JavaScript Console
def buggy_method ... debugger # this will break add any expression on the next line to fix end
The puts method is your friend
puts method is your friendclass Thing < Hyperstack::Component
param initial_mode: 12
before_mount do
state.mode! params.initial_mode
puts "before_mount params.initial_mode=#{params.initial_mode}"
end
after_mount do
@timer = every(60) { force_update! }
puts "after_mount params.initial_mode=#{params.initial_mode}"
end
render do
div(class: :time) do
puts "render params.initial_mode=#{params.initial_mode}"
puts "render state.mode=#{state.mode}"
...
end.on(:change) do |e|
state.mode!(e.target.value.to_i)
puts "on:change e.target.value.to_i=#{e.target.value.to_i}"
puts "on:change (too high) state.mode=#{state.mode}" if state.mode > 100
end
end
end
endHyperTrace
HyperSpec
Last updated
Was this helpful?