Skip to content
This repository was archived by the owner on Oct 19, 2018. It is now read-only.

Commit 603e03b

Browse files
committed
#176 patch
1 parent 4f5ea84 commit 603e03b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/reactive-ruby/isomorphic_helpers.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,20 @@ def self.included(base)
66

77
if RUBY_ENGINE != 'opal'
88
def self.load_context(ctx, controller, name = nil)
9+
puts "************************** React Server Context Initialized #{name} *********************************************"
910
@context = Context.new("#{controller.object_id}-#{Time.now.to_i}", ctx, controller, name)
1011
end
1112
else
1213
def self.load_context(unique_id = nil, name = nil)
1314
# can be called on the client to force re-initialization for testing purposes
1415
if !unique_id || !@context || @context.unique_id != unique_id
16+
if on_opal_server?
17+
`console.history = []` rescue nil # <<<<<<<<<<----- add this line
18+
message = "************************ React Prerendering Context Initialized #{name} ***********************"
19+
else
20+
message = "************************ React Browser Context Initialized ****************************"
21+
end
22+
log(message)
1523
@context = Context.new(unique_id)
1624
end
1725
@context

0 commit comments

Comments
 (0)