Class: JsxRosetta::IR::EventBinding

Inherits:
Data
  • Object
show all
Includes:
Node
Defined in:
lib/jsx_rosetta/ir/types.rb

Overview

An event handler binding. Lowered from a JSX attribute named ‘on<Event>` whose value is an expression container.

event : String — lowercased DOM event name (“click”, “change”,

"mouseenter").

handler : Interpolation — the JS expression bound to the event,

verbatim. For ViewComponent + Stimulus, the caller is
expected to supply a Stimulus action descriptor string
(e.g. "click->my-controller#handleClick"); the component
just renders it through.

Instance Attribute Summary collapse

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event

Returns:

  • (Object)

    the current value of event



217
218
219
# File 'lib/jsx_rosetta/ir/types.rb', line 217

def event
  @event
end

#handlerObject (readonly)

Returns the value of attribute handler

Returns:

  • (Object)

    the current value of handler



217
218
219
# File 'lib/jsx_rosetta/ir/types.rb', line 217

def handler
  @handler
end