Sha256: 14dbccc7df7bd174bbf7903ae2e6985e8aa0871335596cad1fd2ca8f1ade0134

Contents?: true

Size: 474 Bytes

Versions: 48

Compression:

Stored size: 474 Bytes

Contents

module React
  module Component
    module EventHandler
      def event_handlers
        @event_handlers ||= []
      end

      def event_handler(name, &block)
        event_handlers << name
        %x{
          self.react_component.prototype[name] = function(event, info) {
            #{ruby_event = ::React::SyntheticEvent.new(`event`)};
            #{`this.__ruby_instance`.instance_exec(ruby_event, `info`, &block)};
          }
        }
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
isomorfeus-react-16.9.8 lib/react/component/event_handler.rb
isomorfeus-react-16.9.7 lib/react/component/event_handler.rb
isomorfeus-react-16.9.6 lib/react/component/event_handler.rb
isomorfeus-react-16.9.5 lib/react/component/event_handler.rb
isomorfeus-react-16.9.4 lib/react/component/event_handler.rb
isomorfeus-react-16.9.3 lib/react/component/event_handler.rb
isomorfeus-react-16.9.2 lib/react/component/event_handler.rb
isomorfeus-react-16.9.1 lib/react/component/event_handler.rb
isomorfeus-react-16.9.0 lib/react/component/event_handler.rb
isomorfeus-react-16.8.9 lib/react/component/event_handler.rb
isomorfeus-react-16.8.8 lib/react/component/event_handler.rb
isomorfeus-react-16.8.7 lib/react/component/event_handler.rb
isomorfeus-react-16.8.6 lib/react/component/event_handler.rb
isomorfeus-react-16.8.5 lib/react/component/event_handler.rb
isomorfeus-react-16.8.4 lib/react/component/event_handler.rb
isomorfeus-react-16.8.3 lib/react/component/event_handler.rb
isomorfeus-react-16.8.2 lib/react/component/event_handler.rb
isomorfeus-react-16.8.1 lib/react/component/event_handler.rb
isomorfeus-react-16.8.0 lib/react/component/event_handler.rb
isomorfeus-react-16.6.8 lib/react/component/event_handler.rb