Sha256: d1bc8e76a04db206ab6705652a77bff61c29c3020bfc94f026f064153bf61266

Contents?: true

Size: 562 Bytes

Versions: 5

Compression:

Stored size: 562 Bytes

Contents

module React
  module Component

    module ClassMethods

      def router_param(name, &block)
        define_state name
        before_mount do
          send("#{name}!", yield(params[:params][name]))
        end
        before_receive_props do |new_params|
          send("#{name}!", yield(new_params[:params][name]))
        end
      end

    end

    def route_handler
      Router::RR::RouteHandler()
    end

    def link(opts = {}, &block)
      opts[:params] = opts[:params].to_n if opts[:params]
      Router::RR::Link(opts, &block)
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
reactive-router-0.7.3 lib/reactive-router/component.rb
reactive-router-0.7.2.1 lib/reactive-router/component.rb
reactive-router-0.7.2 lib/reactive-router/component.rb
reactive-router-0.7.1 lib/reactive-router/component.rb
reactive-router-0.2.0 lib/reactive-router/component.rb