Closed MicahZoltu closed 5 years ago
Curiously, why await this.outstandingFetch
run before cancelling the scheduler?
If there is an outstanding promise, when it resolves it will queue up another scheduled timer when it finishes. We have to first wait for the promise to finish, then for it to queue up the next timer, then immediately cancel that timer.
The other option would be to make the awaitable function cancelable, but that is more work than relying on some sketchy ordering of operations...
See the finally block of the fetch
function.
I see, this is instead of setting some sort of a "cancelled" flag that is checked before scheduling again. Got it.
These defaults made coding easier because we had a
number
instead ofnumber | null
but they prevented us from differentiating between "loading" and "loaded". This change is breaking (hence the major version bump) but I believe it is the right move, and I'm not sure why I decided to not do this in the first place.The recursive-fs update just makes it so the CLI doesn't print an empty line on success or an error on delete when the directory doesn't exist (QoL improvements).
The new tsconfig.json is just so VS Code is capable of processing the files, since it will only use a file named
tsconfig.json
.