I want to check if table.value is equal to 'Stack' or 'Overflow'.
I would like to do something like this:
rv-if="table.value | eq 'Stack' | or (table.value | eq 'Overflow')"
rivets.formatters.eq = function (value, args) {
return value === args;
};
rivets.formatters.or = function (value, args) {
return value || args;
};
I would like to use those 2 formatters to achieve this.
I know I can have a specific formatter like this to achieve my functionality.
rivets.formatters.checkIfValueEqualsEitherArg = function (value, arg1, arg2) {
return (value === arg1) || (value===arg2);
};
But, I would rather use the above two generic formatters (eq and or).
What is the best way to achieve this
Update
Since, I was not able to get any help on this here, or elsewhere, this is what I have done to achieve my functionality. I am still waiting on right response.
rv-if="table.value | checkIfValueEqualsEitherArg 'Stack' 'Overflow'"