Skip to content

Instantly share code, notes, and snippets.

@rohanBagchi
Created April 27, 2018 04:49
Show Gist options
  • Select an option

  • Save rohanBagchi/9969652ad97c209402ba81b185caafc9 to your computer and use it in GitHub Desktop.

Select an option

Save rohanBagchi/9969652ad97c209402ba81b185caafc9 to your computer and use it in GitHub Desktop.
var resolve = function (value) {
if (status !== PENDING) return;
try {
success_callbacks.forEach(cb => cb.call(null, value));
success_callbacks = [];
status = RESOLVED;
} catch (e) {
this.reject(e);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment