rubyx-debugger/app/instruction_view.rb
2015-07-25 15:28:59 +03:00

26 lines
430 B
Ruby

class InstructionView
include React::Component
required_param :interpreter
required_param :instruction
define_state :active => ""
before_mount do
interpreter.register_event(:instruction_changed, self)
end
def instruction_changed old , ins
active! instruction == ins ? "active" : ""
end
def render
return unless instruction
div :class => active do
instruction.to_s
end
end
end