UNPKG

use-axios

Version:

Simple Axios hook for React. Use React Suspense to show loading indicator and Error Boundary to handle request errors.

18 lines (14 loc) 804 B
export default function obsoleteWithReplacement(replacementFunction, oldFn, newFn) { var warned; function wrapper() { if (!warned) { var _console, _console$warn; warned = true; (_console = console) === null || _console === void 0 ? void 0 : (_console$warn = _console.warn) === null || _console$warn === void 0 ? void 0 : _console$warn.call(_console, "WARNING! Obsolete function called. ".concat(oldFn, " has been deprecated and will be removed in the next major release. Please use the new ").concat(newFn, " instead.")); } return replacementFunction.call.apply(replacementFunction, [this].concat(Array.prototype.slice.call(arguments))); } wrapper.prototype = replacementFunction.prototype; return wrapper; } //# sourceMappingURL=obsoleteWithReplacement.js.map