Module: Fron::Behaviors::Events
- Included in:
- Component
- Defined in:
- opal/fron/core/behaviors/events.rb
Overview
Behavior for handling events on components.
Class Method Summary collapse
-
.included(base) ⇒ Object
Runs for included classes.
-
.on(item) ⇒ Object
Applies events from the registry.
Class Method Details
.included(base) ⇒ Object
Runs for included classes
9 10 11 |
# File 'opal/fron/core/behaviors/events.rb', line 9 def self.included(base) base.register self, [:on] end |
.on(item) ⇒ Object
Applies events from the registry
16 17 18 19 20 21 22 23 |
# File 'opal/fron/core/behaviors/events.rb', line 16 def self.on(item) args = item[:args] if args.length == 3 delegate(args[0], args[1]) { |event| send args[2], event } else on(args[0]) { |event| send args[1], event } end end |