MCPcopy Create free account
hub / github.com/6pac/SlickGrid / onFileChanged

Function onFileChanged

scripts/dev-watch.mjs:106–114  ·  view source on GitHub ↗

* On file changes, we will perform a rebuild and/or reload the browser depending on the file extension being detected. * We add a setTimeout delay to throttle the callbacks to avoid calling the build too often. * @param {String} filepath - file path that changed

(filepath)

Source from the content-addressed store, hash-verified

104 * @param {String} filepath - file path that changed
105 */
106 function onFileChanged(filepath) {
107 if (timer) {
108 clearTimeout(timer);
109 }
110 changedFiles.add(filepath);
111 timer = setTimeout(() => {
112 executeCommandCallback(Array.from(changedFiles).pop());
113 }, 150);
114 }
115
116 function hasQueuedChanges() {
117 if (changedFiles.size > 0) {

Callers 1

initFunction · 0.85

Calls 1

executeCommandCallbackFunction · 0.85

Tested by

no test coverage detected