Module: React::IsomorphicHelpers::ClassMethods
- Defined in:
- lib/reactive-ruby/isomorphic_helpers.rb
Instance Method Summary collapse
- #before_first_mount(&block) ⇒ Object
- #controller ⇒ Object
- #isomorphic_method(name, &block) ⇒ Object
- #log(*args) ⇒ Object
- #on_opal_client? ⇒ Boolean
- #on_opal_server? ⇒ Boolean
- #prerender_footer(&block) ⇒ Object
Instance Method Details
#before_first_mount(&block) ⇒ Object
182 183 184 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 182 def before_first_mount(&block) React::IsomorphicHelpers::Context.register_before_first_mount_block &block end |
#controller ⇒ Object
178 179 180 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 178 def controller IsomorphicHelpers.context.controller end |
#isomorphic_method(name, &block) ⇒ Object
191 192 193 194 195 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 191 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
174 175 176 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 174 def log(*args) IsomorphicHelpers.log(*args) end |
#on_opal_client? ⇒ Boolean
170 171 172 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 170 def on_opal_client? IsomorphicHelpers.on_opal_client? end |
#on_opal_server? ⇒ Boolean
166 167 168 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 166 def on_opal_server? IsomorphicHelpers.on_opal_server? end |
#prerender_footer(&block) ⇒ Object
186 187 188 |
# File 'lib/reactive-ruby/isomorphic_helpers.rb', line 186 def (&block) React::IsomorphicHelpers::Context. &block end |