Skip to content

Commit

Permalink
Update README example
Browse files Browse the repository at this point in the history
  • Loading branch information
briancavalier committed May 15, 2017
1 parent 5c0a9eb commit 47c5044
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 47c5044

Please sign in to comment.