S
SolidJS3mo ago
Luka

Abort server function

I want to allow users to upload image in preview stage, then I have a button where they can decide if they want to upload the image to server then s3, But when user decides to upload the image to server and clicks a "upload" button, "Cancel" button appears. What I want to achieve is when user clicks "Cancel" button I want to abort the server function execution.
2 Replies
Madaxen86
Madaxen863mo ago
Nothing solid specific here. You can just use the AbortController api in your event handler https://developer.mozilla.org/en-US/docs/Web/API/AbortController
MDN Web Docs
AbortController - Web APIs | MDN
The AbortController interface represents a controller object that allows you to abort one or more Web requests as and when desired.
Luka
LukaOP3mo ago
Thanks a lot I will try it soon.
Want results from more Discord servers?
Add your server