Skip to content

Commit 41ad714

Browse files
committed
closes issue #403
1 parent 2362c10 commit 41ad714

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

docs/hyper-state/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@ class DisplaySquare
348348
.on(:click) { Game.handle_click(id) }
349349
end
350350
end
351+
351352
class 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
503504
would 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
507508
a store mutates, then all the components that recorded observations will be rerendered.

release-notes/1.0.alpha1.8.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ None
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

ruby/hyper-spec/lib/hyper-spec/helpers.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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

ruby/hyper-spec/spec/hyper_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)