Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am ilancohen on github.
  • I am ilancohen (https://keybase.io/ilancohen) on keybase.
  • I have a public key whose fingerprint is AEEC CDCC 1A3C C461 A9E0 83FA 6460 1883 1A24 B2DC

To claim this, I am signing this object:

@ilancohen
ilancohen / reusable.deferred.js
Created August 18, 2013 07:46
Reusable deferreds and promises: Deferreds are by definition not reusable. But if you want to create chainable callbacks that can be reused, this might be an option.
ReusableDeferred = (function(){
function defer() {
var deferred = (function(){
var self = {
d: {
savedSuccesses: [], //used to cache responses if needed
savedErrors: []
}
};
function resolveSuccesses() {