Browse files

Merge branch 'shiftspace'

  • Loading branch information...
2 parents 1f8555f + 5188ce1 commit c83fcad049e24f9be71f6931898129970af8b107 @swannodette swannodette committed Nov 16, 2009
Showing with 22 additions and 1 deletion.
  1. +22 −1 readme.textile
@@ -476,4 +476,25 @@ if you changed something in doA that change would appear in doB because
you called doA first. However, using Promises is very much like writing code
with threads. You have no such guarantees.
-h2. Lazy Values
+h2. Lazy Values
+Sometimes it's very useful to be able to operate on values that don't actually
+exist yet. This is useful even when no remote request are involved. For example:
+var add = function(a, b) { return a + b; }.decorate(promise);
+var a = $lazy();
+var b = $lazy();
+var sum = add(a, b);
+sum.value(); // -> undefined
+sum.value(); // -> undefined
+sum.value(); // -> 5
+Pretty cool.
+Things get really interesting when you come to realize you can use this functionality
+with the DOM :)

0 comments on commit c83fcad

Please sign in to comment.