MCPcopy Create free account
hub / github.com/NativeScript/SimDeck / watchFiles

Function watchFiles

scripts/experimental/swiftui-preview.mjs:1118–1126  ·  view source on GitHub ↗
(files, callback)

Source from the content-addressed store, hash-verified

1116}
1117
1118function watchFiles(files, callback) {
1119 let timer = null;
1120 for (const file of files) {
1121 fs.watchFile(file, { interval: 250 }, () => {
1122 clearTimeout(timer);
1123 timer = setTimeout(callback, 120);
1124 });
1125 }
1126}
1127
1128function payloadWrapperSource(previewBody, moduleName, sourceModuleName) {
1129 return `import SwiftUI

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected