Created
September 27, 2018 12:11
-
-
Save barisere/6f738348f3517611d229bacd7a65f18a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const deleteRequests = new WeakMap<Element, number>(); | |
const delayDeleteResource = function (resourceId: string, delay: number) { | |
const request = new XMLHttpRequest() | |
request.open('DELETE', `https://yourdomain/resource/${resourceId}`, true); | |
// other steps for initializing the request, attaching listeners, ... | |
return setTimeout(request.send.bind(request), delay); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment