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
Would be breaking, but IMHO is a bit more natural in terms of being given access to both abort and the promise at the same execution point, and avoiding fetch specific details, and dependency injection.
The text was updated successfully, but these errors were encountered:
Right now this library use fetch for getting the signed credentials for uploading, but not for performing the upload. To do the upload we rely on lib-storage. I think at this point in time I don't have the bandwidth to have this library support multiple http clients.
It's rather useful (especially if filesizes are large), to be able to abort an upload
Just need to modify: https://github.com/ryanto/next-s3-upload/blob/master/packages/next-s3-upload/src/hooks/use-uploader.ts#L122
Looks like this:
Easiest is probably just to accept
controller
as an arg to.uploadToS3/2
:See: https://javascript.info/fetch-abort#using-with-fetch
However, better is likely to modularize the http lib in the event that a use-case prefers something other than
fetch
, likeaxios
orrequest
, etc.A syntax like:
Would be breaking, but IMHO is a bit more natural in terms of being given access to both
abort
and thepromise
at the same execution point, and avoidingfetch
specific details, and dependency injection.The text was updated successfully, but these errors were encountered: