Skip to content
This repository was archived by the owner on Jan 18, 2021. It is now read-only.

Commit a971735

Browse files
GitBrentGitBrent
GitBrent
authored and
GitBrent
committed
Updated Promise section
1 parent 5dccf51 commit a971735

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,16 +180,16 @@ SpRestLib not only provides a simple REST interface, it also delivers next-gener
180180

181181
SharePoint applications and utilities frequently require many operations be done (e.g.: read from many lists at startup) or steps be performed (e.g.: get an item, then do further operations depending upon the result). The way we've done this until recently is by using callbacks, which are now obsolete. Promises wait until the previous query completes, which makes async operations easy to chain without any callbacks.
182182

183-
See the [Async Operations via Promises](#async-operations-via-promises) section for more information.
183+
See the [Async Operations via Promises](#async-operations-via-promises) section for more information and examples.
184184

185185
```javascript
186-
// A: Get current user's ID
186+
// EX: Get the current user's ID, then get their Tasks
187187
sprLib.user().info()
188188
.then(function(objUser){
189-
return sprLib.list('Tasks').getItems({ listCols:['Id','Title'], queryFilter:'Owner/Id eq ' + objUser.Id });
189+
return sprLib.list('Tasks').getItems({ queryFilter:'Owner/Id eq ' + objUser.Id });
190190
})
191191
.then(function(arrItems){
192-
console.log("Current user's Tasks = " + arrItems.length);
192+
console.log("Current user's Tasks = " + arrItems.length);
193193
})
194194
.catch(errMsg => console.error(errMsg));
195195
```

0 commit comments

Comments
 (0)