Bnaya Peretz
Bnaya Peretz
I have a variadic variant of that function, but i'm not sure if its 100% correct types: ```ts function lazyInferenceTypeUnionVariadic< ARGS extends Array >(...args: ARGS): LazyInferenceModelType { return t.union(...args); }...
Hey @xaviergonz I would like your feedback for these union wrappers, They simplify the emitted declarations for unions on some cases I've also wrote variadic variants that will not require...
Worth noting, typescript 4.2 has feature that i believe will drastically improve our use-case: Smarter Type Alias Preservation https://devblogs.microsoft.com/typescript/announcing-typescript-4-2/#smarter-type-alias-preservation
I'm missing something: how to cancel the actual in-flight operation (like XHR) and not just ignore the result. this is possible with passing an AbortController
@duro i find it hard to believe. how did you check? lets say i'm fetching 50mb, and after 1MB i abort the xhr (or fetch()) you say that the browser...
@mweststrate Actually as chrome 66, it's supported in all major browsers for fetch, using AbortController (somekind of cancellation token) And seems that it will be the de-facto api for cancelling...
Im in favor to aducate developers to use the acceptable practices of async operation cancelation, With after fetch got its abort controller, thats the way to go. And then the...
Throwing in on-going spec-level efforts to make cancelation standard: Addin AbortController + AbortSignal to ES spec https://github.com/tc39/proposal-observable/issues/201 Stage 2: https://github.com/tc39/proposal-explicit-resource-management Symbol based mechanism `Symbol.dispose`
IMO abort token/controller based pattern can be implemented on user-land, and can be abstracted-away easily when any spec will materialized.
AbortController & signal are now also part of node, which make it de-factor way to cancel things in js. abort signal is added to more and more browser & node...