Skip to content

Commit 7b2ee6e

Browse files
committed
router history adaptable to param_accessor_style
1 parent 99711d1 commit 7b2ee6e

File tree

2 files changed

+15
-4
lines changed

2 files changed

+15
-4
lines changed

ruby/hyper-component/lib/hyperstack/internal/component/instance_methods.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def children
1010

1111
def params
1212
if @__hyperstack_component_params_wrapper.param_accessor_style == :hyperstack
13-
debugger
1413
raise "params are now directly accessible via instance variables.\n"\
1514
' to access the legacy behavior add `param_accessor_style = :legacy` '\
1615
"to your component class\n"\

ruby/hyper-router/lib/hyperstack/router/helpers.rb

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,27 @@ module Hyperstack
22
module Router
33
module Helpers
44
def match
5-
@match
5+
if @__hyperstack_component_params_wrapper.param_accessor_style != :hyperstack
6+
params.match
7+
else
8+
@match
9+
end
610
end
711

812
def location
9-
@location
13+
if @__hyperstack_component_params_wrapper.param_accessor_style != :hyperstack
14+
params.location
15+
else
16+
@location
17+
end
1018
end
1119

1220
def history
13-
@history
21+
if @__hyperstack_component_params_wrapper.param_accessor_style != :hyperstack
22+
params.history
23+
else
24+
@history
25+
end
1426
end
1527

1628
def self.included(base)

0 commit comments

Comments
 (0)