Module: React::IsomorphicHelpers::ClassMethods

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

Instance Method Summary collapse

Instance Method Details

#before_first_mount(&block) ⇒ Object



207
208
209
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 207

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

#controllerObject



203
204
205
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 203

def controller
  IsomorphicHelpers.context.controller
end

#isomorphic_method(name, &block) ⇒ Object



216
217
218
219
220
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 216

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

#log(*args) ⇒ Object



199
200
201
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 199

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

#on_opal_client?Boolean

Returns:



195
196
197
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 195

def on_opal_client?
  IsomorphicHelpers.on_opal_client?
end

#on_opal_server?Boolean

Returns:



191
192
193
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 191

def on_opal_server?
  IsomorphicHelpers.on_opal_server?
end


211
212
213
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 211

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