Skip to content

Instantly share code, notes, and snippets.

Avatar
🐢
hello world

Clint Ayres jurassix

🐢
hello world
View GitHub Profile
@jurassix
jurassix / abortable.js
Last active Apr 21, 2016 — forked from spudly/abortable.js
Abort your promises!
View abortable.js
const abortable = (func) => (...args) => {
let aborted = false;
const abort = () => { aborted = true; };
const promise = new Promise((resolve, reject) => {
const resolveIfNotAborted = resolution => {
if (aborted) {
reject(Error('promise aborted'));
}
You can’t perform that action at this time.