File tree Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Expand file tree Collapse file tree 4 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -348,6 +348,7 @@ class DisplaySquare
348348 .on(:click ) { Game .handle_click(id) }
349349 end
350350end
351+
351352class DisplayBoard < HyperComponent
352353 render(DIV ) do
353354 (0 ..6 ).step(3 ) do |row |
@@ -503,5 +504,5 @@ a component **unless** the state will be accessed outside the component. Howev
503504would be better off to move the state into a separate store.
504505
505506> In addition components also act as the ** Observers** in the system. What this means is
506- that current component that is running its render method is recording all stores that call ` observe ` , when
507+ that the current component that is running its render method is recording all stores that call ` observe ` , when
507508a store mutates, then all the components that recorded observations will be rerendered.
Original file line number Diff line number Diff line change 2424
2525### Feature Added
2626+ [ #401 ] ( https://github.com/hyperstack-org/hyperstack/issues/401 ) Can call ` receives ` inside the singleton class.
27- + [ #124 ] ( https://github.com/hyperstack-org/hyperstack/issues/124 ) HyperModel time now is in milliseconds
2827
2928### Fixed
3029
Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ def before_mount(&block)
8282
8383 def isomorphic ( &block )
8484 yield
85- before_mount ( &block )
85+ if page . instance_variable_get ( '@hyper_spec_mounted' )
86+ internal_evaluate_ruby ( &block )
87+ else
88+ before_mount ( &block )
89+ end
8690 end
8791
8892 # Allows options to the mount method to be specified globally
Original file line number Diff line number Diff line change @@ -108,6 +108,20 @@ def factorial(n)
108108 expect ( evaluate_ruby ( 'factorial(5)' ) ) . to eq ( factorial ( 5 ) )
109109 end
110110
111+ it "can load isomorphic code after loading" do
112+ on_client do
113+ CONSTANT = 1
114+ end
115+ CONSTANT = 1
116+ isomorphic do
117+ def factorial ( n )
118+ n ==CONSTANT ? CONSTANT : n * factorial ( n -CONSTANT )
119+ end
120+ nil
121+ end
122+ expect ( evaluate_ruby ( 'factorial(5)' ) ) . to eq ( factorial ( 5 ) )
123+ end
124+
111125 context 'promise helpers' do
112126 # just to demonstrate a few things:
113127 # 1 - You can use methods like mount, isomorphic, on_client in before(:each) blocks
You can’t perform that action at this time.
0 commit comments