code: function _constructInvariant(f, invariant) {
      return function _wrapped() {
          var before = JSON.parse(JSON.stringify(this));
          var ret = f.apply(this, arguments);
          var arr = [before];
          invariant.apply(this, arr.concat.apply(arr, arguments));
          return ret;
      };
  }
docs: A method that generates a function which will wrap the function `f` and call the invariant with (before, arg1, arg2, ...)