MCPcopy
hub / github.com/MALSync/MALSync / changeDetect

Function changeDetect

src/utils/general.ts:126–139  ·  view source on GitHub ↗
(callback, func, immediate = false)

Source from the content-addressed store, hash-verified

124}
125
126export function changeDetect(callback, func, immediate = false) {
127 let currentPage = func();
128 const intervalId = setInterval(function () {
129 const temp = func();
130 if (typeof temp !== 'undefined' && currentPage !== temp) {
131 currentPage = func();
132 callback();
133 }
134 }, 500);
135
136 if (immediate) callback();
137
138 return Number(intervalId);
139}
140
141export function waitUntilTrue(condition: Function, callback: Function, interval = 200) {
142 // eslint-disable-next-line @typescript-eslint/no-misused-promises

Callers

nothing calls this directly

Calls 1

callbackClass · 0.50

Tested by

no test coverage detected