Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Component Constructors In HappyX

It possible to create custom component constructor in happyx web framework?
For example:

component A:
  field: int
  
  constructor(args):
    ...

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

Yeap, it possible. Few hours ago this issue was closed in HappyX repo.

So to declare constructor you need

component A:
  field: int
  constructor(a: int):
    self.field = a*5

And usage is

appRoutes "app":
  "/":
    component A->construct(a = 10)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading