4 ms·
Absolutely! You can declare something akin to a function, which takes arguments and emits HTML. Imagine e.g. let taskTemplate = template(task) {
by marcuswestin 16y ago
Absolutely!
You can declare something akin to a function, which takes arguments and emits HTML. Imagine e.g.
let taskTemplate = template(task) {
<div class="task">
<span class="title">task.title</span>
</div>
}
for (task in tasks) { taskTemplate(task) }
I'm not decided on syntax yet.
You can definitely separate out logic from template this way.
Fun outputs javascript, not HTML - the javascript then builds the DOM.
- giantfuzzypanda 16y agoSo if someone has javascript disabled what happens?
- m0th87 16y agoBut it still outputs something that is only consumable by web browsers. It seems to me like the potential productivity gains you'd get out of Fun would only be for tightly coupled systems where you're not worried about exposing an API, and all clients use web browsers.