You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently in the current proposal there is no specific course of action that should be taken when cancellation is actually hit.
This causes a lot of boilerplate to deal with if every function has its own specific cancellation error especially when dealing with 'unhandledrejection' and the like.
For example consider an existing example of fetching a resource:
Currently in the current proposal there is no specific course of action that should be taken when cancellation is actually hit.
This causes a lot of boilerplate to deal with if every function has its own specific cancellation error especially when dealing with
'unhandledrejection'
and the like.For example consider an existing example of fetching a resource:
It's already quite cumbersome to add
.catch
onto anyfetch
just to filter out the cancellation error that we don't care about.One alternative is to do something like
return null
in case of cancellation e.g.:However this is painful when using tooling like TypeScript as it changes the return type just to accomodate for a value that can never be used.
Now the previous proposal had a third dedicated "cancelled" state that could propagate up functions like exceptions.
This was quite useful as it meant you could distinguish cancellation easily and could just ignore it if you didn't care about it.
The text was updated successfully, but these errors were encountered: