schneiderfelipe / hyperscript

📎 Create HyperText with Nim.
https://github.com/schneiderfelipe/hyperscript
4 stars 0 forks source link

Implement an element factory #12

Open schneiderfelipe opened 3 years ago

schneiderfelipe commented 3 years ago

The idea is to go beyond simple element generators but create simplified and efficient component/widget generators.

EDIT: Similar to how hyperscript-helpers do it. hyperaxe and elementx are also inspirations.

This can be done without any overhead using macros.

schneiderfelipe commented 3 years ago

This could be an extreme case of composability. See material-hyperscript for a generalized use case.

Specifically, factories can be generalized to be able to:

This can simplify some use cases, see the following widgets as examples of what could be done: