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.10.4 lib/react/component/event_handler.rb
isomorfeus-react-16.10.3 lib/react/component/event_handler.rb
isomorfeus-react-16.10.2 lib/react/component/event_handler.rb
isomorfeus-react-16.10.1 lib/react/component/event_handler.rb
isomorfeus-react-16.9.24 lib/react/component/event_handler.rb
isomorfeus-react-16.9.23 lib/react/component/event_handler.rb
isomorfeus-react-16.9.22 lib/react/component/event_handler.rb
isomorfeus-react-16.9.21 lib/react/component/event_handler.rb
isomorfeus-react-16.9.20 lib/react/component/event_handler.rb
isomorfeus-react-16.9.19 lib/react/component/event_handler.rb
isomorfeus-react-16.9.18 lib/react/component/event_handler.rb
isomorfeus-react-16.9.17 lib/react/component/event_handler.rb
isomorfeus-react-16.9.16 lib/react/component/event_handler.rb
isomorfeus-react-16.9.15 lib/react/component/event_handler.rb
isomorfeus-react-16.9.14 lib/react/component/event_handler.rb
isomorfeus-react-16.9.13 lib/react/component/event_handler.rb
isomorfeus-react-16.9.12 lib/react/component/event_handler.rb
isomorfeus-react-16.9.11 lib/react/component/event_handler.rb
isomorfeus-react-16.9.10 lib/react/component/event_handler.rb
isomorfeus-react-16.9.9 lib/react/component/event_handler.rb