Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

notes on using Promises with Class instances.

  • Loading branch information...
commit 73a3cbcc89070b35ac6474198ef8535340863f29 1 parent 22542d8
@swannodette swannodette authored
Showing with 3 additions and 2 deletions.
  1. +1 −2  Promises.js
  2. +2 −0  examples/exampleB.js
View
3  Promises.js
@@ -5,8 +5,7 @@
http://en.wikipedia.org/wiki/Futures_and_promises
*/
-// hopefully wrap in 2.0 uses the method mutator
-// we put a reference to the wrapper on the fn
+// we need a backreference to wrapper
Class.extend({
wrap: function(self, key, method)
{
View
2  examples/exampleB.js
@@ -28,6 +28,8 @@ var MySubClass = new Class({
add: function(a, b)
{
+ // remember by this point a and b are realized
+ // we're not sending promises to parent!
return this.parent(a, b) + "!";
}.decorate(promise)
});
Please sign in to comment.
Something went wrong with that request. Please try again.