-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Using the proposed /api/cancel
endpoint, make all API calls cancellable.
see https://github.com/Linkurious/linkurious-server/issues/779
How
Add a cancellable
boolean option to all option object of all requests
When options.cancellable
is true:
- generate a random
cancellationToken
and add it to the request parameters - add a cancellation handler in the request response promise chain (
.then(onResolve, onFailure, onCancel)
) - if the promise is cancelled, use the generated
cancellationToken
to cancel the server-side query using the/api/cancel endoint