Keydonix / liquid-long

The Unlicense
8 stars 1 forks source link

Removes default values from polled values. #103

Closed MicahZoltu closed 5 years ago

MicahZoltu commented 5 years ago

These defaults made coding easier because we had a number instead of number | 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.

epheph commented 5 years ago

Curiously, why await this.outstandingFetch run before cancelling the scheduler?

MicahZoltu commented 5 years ago

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...

MicahZoltu commented 5 years ago

See the finally block of the fetch function.

epheph commented 5 years ago

I see, this is instead of setting some sort of a "cancelled" flag that is checked before scheduling again. Got it.