Open PAK90 opened 3 years ago
I'm certainly open to something like that. Perhaps passing in a cancellation token? https://www.npmjs.com/package/cancellationtoken
I've not used that library before; how would it work with filereader?
You would allow a cancellation token to be passed as one of the options. Then in the loop that is searching through the files you would check if the token is cancelled before continuing.
I'm using this library hooked up to a text search field, which calls
filereader.startSearch()
every time the string changes, so as you type in 'bat', it would start a search for 'b', 'ba', and 'bat'. This results in multiple processes running at once, all but the last of which are out of date, so I was wondering if there's a method to stop any existing searches before starting a new one?