Dazinator.Extensions.FileProviders
Dazinator.Extensions.FileProviders copied to clipboard
Watch() extension method that allows include and exclude list.
Implement an extension method for IFileProvider that allows you to watch() for files, but using an include list and exclude list (of glob patterns, using DotNet.Glob
Have raised an issue to see if microsoft would consider putting this in the IFileProvider contract, as it allows more granular control of which files you are monitoring, which could be better for performance reasons: https://github.com/aspnet/FileSystem/issues/253
The way I see this working, is to call Watch() on the underlying provider for each include pattern. Then evaluate the exclude patterns after the change tokens from the underlying provider are signalled. To do this, I need to be able to tell which file triggered the change token. May not be possible.