Ability to unregister umami

This commit is contained in:
Bartosz Hernas 2020-09-14 18:13:59 +02:00
parent 8727dbf282
commit 2ea91aaabf
2 changed files with 15 additions and 5 deletions

View file

@ -39,12 +39,14 @@ export const put = (url, params) => apiRequest('put', url, JSON.stringify(params
export const hook = (_this, method, callback) => {
const orig = _this[method];
return (...args) => {
_this[method] = (...args) => {
callback.apply(null, args);
return orig.apply(_this, args);
};
return () => {
_this[method] = orig;
};
};
export const doNotTrack = () => {