summaryrefslogtreecommitdiff
path: root/web-ui/app/js/mixins/with_feature_toggle.js
blob: 2b071e688ca1c13f030da4e03841a6f429939d7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
define(['features'],
  function(features) {

    function withFeatureToggle(componentName) {
      return function() {

        this.around('initialize', function(basicInitialize) {
          if(features.isEnabled(componentName)) {
            return basicInitialize(arguments[1], arguments[2]);
          }
        });
      };
    }

    return withFeatureToggle;

});