universal hyperscript helper for fancy syntax
Writing hyperscript can be cumbersome. This might be an alternative to JSX and alike
Imagine instead of
<button ="btn">Click Me</button>
you can write
Well thats possible with tagl
Init tagl with your hyperscript lib, e. g. mithril.js.
const t =
const t =
// myView.jsconst div span button = tdiv
same in plain mithril would be
const m =
There are two ways to create and use components. One global and one local. Use global components for general reusable widgets like date picker or dropdowns and alike.
// define it and set it on the tagl instance// `myDatePicker` must be a component definition that is supported by your vdom library// it will be used instead of the tag nametdatePicker = myDatePicker// use itconst div datePicker = t
Sometimes you just need sub-state at a specific point and you don't want to create a globaly available component. In this case you can use local components.
const div = t// define it and store it in a variable// `myDatePicker` must be a component definition that is supported by your vdom library// it will be used instead of the tag nameconst myLocalComponent =// use it