Skip to content
This repository has been archived by the owner on Dec 5, 2023. It is now read-only.

Commit

Permalink
Use destroyables not deferrables
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Jun 20, 2012
1 parent 0cb35a9 commit 4640500
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/lib/destroyable.js
Expand Up @@ -26,6 +26,12 @@ lib.destroyable = function (_public, _protected) {
return destroyable; return destroyable;
}; };


// Make the deferrable fail when the destroyable is destroyed.
_public.chainedDeferrable = function (deferrable) {
_public.onDestroy(deferrable.reject);
return deferrable;
};

// Either chain a DOM node to the current destroyable, or create a new <div> that will // Either chain a DOM node to the current destroyable, or create a new <div> that will
// be destroyed when this destroyable is destroyed. // be destroyed when this destroyable is destroyed.
_public.destroyableDiv = function (node) { _public.destroyableDiv = function (node) {
Expand All @@ -35,4 +41,6 @@ lib.destroyable = function (_public, _protected) {
}); });
return node; return node;
}; };

return _public;
}; };

0 comments on commit 4640500

Please sign in to comment.