MCPcopy
hub / github.com/MALSync/MALSync / fullUrlChangeDetect

Function fullUrlChangeDetect

src/utils/general.ts:113–124  ·  view source on GitHub ↗
(callback, strip = false)

Source from the content-addressed store, hash-verified

111}
112
113export function fullUrlChangeDetect(callback, strip = false) {
114 let currentPage = '';
115 const intervalId = setInterval(function () {
116 const url = strip ? urlStrip(window.location.href) : window.location.href;
117 if (currentPage !== url) {
118 currentPage = url;
119 callback();
120 }
121 }, 100);
122
123 return Number(intervalId);
124}
125
126export function changeDetect(callback, func, immediate = false) {
127 let currentPage = func();

Callers

nothing calls this directly

Calls 2

urlStripFunction · 0.85
callbackClass · 0.50

Tested by

no test coverage detected