We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c7f5fe1 commit d9782b0Copy full SHA for d9782b0
renderIf.js
@@ -27,6 +27,16 @@ renderIf.multi = function () {
27
}
28
29
30
+ function elseCondition (elemOrThunk) {
31
+ cases.push({
32
+ priority: 2,
33
+ condition: true,
34
+ elemOrThunk
35
+ });
36
+
37
+ return api;
38
+ }
39
40
function evaluate() {
41
let sortedCases = cases.sort((a, b) => a.priority > b.priority);
42
@@ -45,7 +55,7 @@ renderIf.multi = function () {
45
55
const api = {
46
56
if: createCondition(0),
47
57
elseIf: createCondition(1),
48
- else: createCondition(2),
58
+ else: elseCondition,
49
59
evaluate
50
60
};
51
61
0 commit comments