nbrugger-tgm / reactj

A reactive ui lib for easy MVC

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Feature] Directives

nbrugger-tgm opened this issue · comments

Directives

I want to incoperate features like the v-if from VueJS

Vue

<p v-if="percent == 100">
     Done!
</p>

Current Solution

JLabel label = new JLabel("Done!");
binder.bind("percent",label::setVisible,percent -> percent == 100);

Prefered solution

binder.showIf("percent",label::setVisible,percent -> percent == 100); //enforces boolean conversion

IF directive

Added in 539538c

Reiterated

Issue #42 (Custom DSL) makes this features unnecessary and will replace it.