Defining a helper for every single Session/Reactive var?


#1

So far I’ve had to do things like this, just to check for boolean states:

Template.myTemplate.helpers({
  conditionOne: function () {
    return Session.get('conditionOne');
  },

  conditionTwo: function () {
    return Session.get('conditionTwo');
  }
});

…which seems kind of redundant and a waste of time. Is there anything wrong with just making a single helper like this?

Template.myTemplate.helpers({
  isTruthy: function (varName) {
    return Session.get(varName);
  }
});

#2

@sashko This is why I think we need to have built in state binding system for Templates.