Skip to content

Instantly share code, notes, and snippets.

@romaintailhurat
Created September 12, 2023 08:52
Show Gist options
  • Save romaintailhurat/3818b26d1ac2ef0ea23796407bfa11fc to your computer and use it in GitHub Desktop.
Save romaintailhurat/3818b26d1ac2ef0ea23796407bfa11fc to your computer and use it in GitHub Desktop.
Questionnaires list filtering
Questionnaires list filtering
Empty
type APP-> With input
With input
cancel -> Empty
let fruits = ["Apple", "Banana", "Cherry", "Durian", "Evi",
"Fragola", "Fraise", "Kiwi", "Litchi", "Orange"]
function render(model){
let current_state_name = model.active_states[0].name;
if (current_state_name === "Empty") {
return $("h1",
{style: {color: "darkBlue"}},
"No input",
$("div",
$("ul",
$("li", "Apple"),
$("li", "Banana"),
$("li", "Cherry")
)
)
);
}
if (current_state_name === "With input") {
return $("h1",
{style: {color: "darkBlue"}},
"Input is 'APP'",
$("div",
$("ul",
$("li", "Apple")
)
)
);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment