BarrieH
BarrieH

Reputation: 373

How do I enable params as methods in Hyperstack

I would like to use:

class UserDetails < HyperComponent
  param :user

  render do
    H1 { user.name }
  end

Instead of

class UserDetails < HyperComponent
  param :user

  render do
    H1 { @User.name }
  end

How do I enable this as the default?

Upvotes: 0

Views: 35

Answers (1)

Mitch VanDuyn
Mitch VanDuyn

Reputation: 2878

class HyperComponent
  include Hyperstack::Component
  include Hyperstack::State::Observable
  param_accessor_style :accessors  # this is now the prefered param style
end

Upvotes: 1

Related Questions