Module: React::IsomorphicHelpers::ClassMethods

Defined in:
lib/reactive-ruby/isomorphic_helpers.rb

Instance Method Summary collapse

Instance Method Details

#before_first_mount(&block) ⇒ Object



171
172
173
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 171

def before_first_mount(&block)
  React::IsomorphicHelpers::Context.register_before_first_mount_block &block
end

#controllerObject



167
168
169
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 167

def controller
  IsomorphicHelpers.context.controller
end

#isomorphic_method(name, &block) ⇒ Object



180
181
182
183
184
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 180

def isomorphic_method(name, &block)
  React::IsomorphicHelpers::Context.send(:define_method, name) do |args_as_json|
    React::IsomorphicHelpers::IsomorphicProcCall.new(name, block, *JSON.parse(args_as_json)).result
  end
end

#log(*args) ⇒ Object



163
164
165
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 163

def log(*args)
  IsomorphicHelpers.log(*args)
end

#on_opal_client?Boolean

Returns:

  • (Boolean)


159
160
161
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 159

def on_opal_client?
  IsomorphicHelpers.on_opal_client?
end

#on_opal_server?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 155

def on_opal_server?
  IsomorphicHelpers.on_opal_server?
end


175
176
177
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 175

def prerender_footer(&block)
  React::IsomorphicHelpers::Context.register_prerender_footer_block &block
end