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
348
348
.on(:click ) { Game .handle_click(id) }
349
349
end
350
350
end
351
+
351
352
class DisplayBoard < HyperComponent
352
353
render(DIV ) do
353
354
(0 ..6 ).step(3 ) do |row |
@@ -503,5 +504,5 @@ a component **unless** the state will be accessed outside the component. Howev
503
504
would be better off to move the state into a separate store.
504
505
505
506
> 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
507
508
a store mutates, then all the components that recorded observations will be rerendered.
Original file line number Diff line number Diff line change 24
24
25
25
### Feature Added
26
26
+ [ #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
28
27
29
28
### Fixed
30
29
Original file line number Diff line number Diff line change @@ -82,7 +82,11 @@ def before_mount(&block)
82
82
83
83
def isomorphic ( &block )
84
84
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
86
90
end
87
91
88
92
# 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)
108
108
expect ( evaluate_ruby ( 'factorial(5)' ) ) . to eq ( factorial ( 5 ) )
109
109
end
110
110
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
+
111
125
context 'promise helpers' do
112
126
# just to demonstrate a few things:
113
127
# 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