code: function cloneStateDef(stateDef) {
      stateDef = (stateDef || {});
      return function () {
          var ctx = this;
          return Object.keys(stateDef).reduce((state, k) => {
              var value = stateDef[k];
              state[k] = (typeof value === 'function' ? value.call(ctx) : value);
              return state;
          }, {});
      };
  }
docs: Returns a function that returns a clone of the object passed to it initially