JSideris / DOThtml

A human-friendly way to build highly-dynamic web pages in pure JavaScript.
2 stars 4 forks source link

Component factory. #153

Closed JSideris closed 5 months ago

JSideris commented 7 months ago

The component factory will take in a class with a build function and extend it with other fields. This will be a move away from the DotComponent abstract class, prompting a major version increase.

Proposed syntax:

export default const dot.component(({html, css, })=>class implements IComponent{
    build(){
        return html.div("Hello, world!");
    }
});

The advantage to this is that moving away from abstract classes allows the framework to be used with DI.