Merge remote-tracking branch 'origin/master' into next

This commit is contained in:
Leo Horie 2014-06-04 08:21:08 -04:00
commit 161fbec443

View file

@ -138,12 +138,17 @@ In the example below, we take advantage of queuing to debug the AJAX response da
```javascript ```javascript
var users = m.request({method: "GET", url: "/user"}) var users = m.request({method: "GET", url: "/user"})
.then(console.log); .then(log);
.then(function(users) { .then(function(users) {
//add one more user to the response //add one more user to the response
return users.concat({name: "Jane"}) return users.concat({name: "Jane"})
}) })
function log(load) {
console.log(load)
return load
}
//assuming the response contains the following data: `[{name: "John"}, {name: "Mary"}]` //assuming the response contains the following data: `[{name: "John"}, {name: "Mary"}]`
//then when resolved (e.g. in a view), the `users` getter-setter will contain a list of users //then when resolved (e.g. in a view), the `users` getter-setter will contain a list of users
//i.e. users() //[{name: "John"}, {name: "Mary"}, {name: "Jane"}] //i.e. users() //[{name: "John"}, {name: "Mary"}, {name: "Jane"}]