fix console.log higher-order calls in docs
This commit is contained in:
parent
d3c9a28c25
commit
9a00707eeb
3 changed files with 17 additions and 5 deletions
|
|
@ -139,8 +139,13 @@ As you saw, you can chain operations that act on the response data. Typically th
|
|||
In the example below, we take advantage of queuing to debug the AJAX response data prior to doing further processing on the user list
|
||||
|
||||
```javascript
|
||||
//a FP-friendly console.log
|
||||
var log = function(value) {
|
||||
console.log(value)
|
||||
}
|
||||
|
||||
var users = m.request({method: "GET", url: "/user"})
|
||||
.then(console.log);
|
||||
.then(log);
|
||||
.then(function(users) {
|
||||
//add one more user to the response
|
||||
return users.concat({name: "Jane"})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue