choojs / choojs/nanohtml

Conditional resolution

Open
#59 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
688
Forks
48
PR merge metrics
No merged PRs in 30d

Description

Is there any solution of implying `if..else` logic with templates?

As (as far as I know) we can't put `if` statement directly in body of `${ }`, there is probably a need for dedicated `if` function e.g. `bel.if(condition, onTrue, onFalse)`.

Is something as that envisioned, or maybe already there's some solution (or convention) coined for that?

Unfortunately [wiki](https://github.com/shama/bel/wiki) is very silent on that very common use case.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.