Permalink
Browse files

Update README example

  • Loading branch information...
briancavalier committed May 15, 2017
1 parent 5c0a9eb commit 47c5044c7cc2039b45471d602c4a0da587bd3788
Showing with 4 additions and 3 deletions.
  1. +4 −3 README.md
View
@@ -12,7 +12,7 @@ When.js is a rock solid, battle-tested [Promises/A+](http://promises-aplus.githu
* Execute tasks in parallel or sequentially
* Transform Node-style and other callback-based APIs into promise-based APIs
-When.js is one of the many stand-alone components of [cujoJS](http://cujojs.com), the JavaScript Architectural Toolkit.
+When.js is one of the many stand-alone components of [cujoJS](http://cujojs.com), the JavaScript Architectural Toolkit.
Check it out:
@@ -57,8 +57,9 @@ fetchRemoteGreeting()
});
function fetchRemoteGreeting() {
- // returns a when.js promise for 'hello world'
- return rest('http://example.com/greeting');
+ // convert native Promise to a when.js promise for 'hello world'
+ var result = rest('http://example.com/greeting');
+ return when(result)
}
function addExclamation(greeting) {

0 comments on commit 47c5044

Please sign in to comment.