Skip to content

probe-web / @probe-web/artifacts / watchFile

Function: watchFile()

ts
function watchFile(
   handle, 
   onChange, 
   opts?
): () => void;

Defined in: index.ts:120

Poll a file handle's lastModified/size; fire once the file has settled. The first read is the baseline and does not fire. If a read fails (permission revoked, file gone) polling continues and the next successful read becomes the new baseline. Returns a function that stops polling.

Parameters

ParameterType
handleFileHandleLike
onChange(a) => void
optsWatchOptions

Returns

() => void