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

Commit 1b6dd31

Browse files
GitBrentGitBrent
GitBrent
authored and
GitBrent
committed
Minor verbiage updates
1 parent a971735 commit 1b6dd31

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

README.md

+10-9
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Provides a clean, concise API that greatly simplifies asynchronous REST interact
77
items (CRUD), execute REST calls, and gather site/user/group information. Enables rapid development of SharePoint Apps/Add-ins
88
using the JavaScript SharePoint App Model.
99

10-
### Features:
10+
### Library Features:
1111
* Simple - Most REST/Web Service interaction can be done in a few lines of code
1212
* Modern - Lightweight, pure JavaScript solution
1313
* Elegant - Utilizes the new [ES6 Promise](http://www.datchley.name/es6-promises/) architecture for asynchronous operations
@@ -156,7 +156,7 @@ var sprLib = require("sprestlib");
156156
## SpRestLib via Console
157157
Want to try SpRestLib on your site?
158158
Just open an F12 developer window on any page under your SharePoint site and run the following snippet
159-
that will load the SpRestLib bundle script dynamically:
159+
to load the SpRestLib bundle script dynamically:
160160

161161
```javascript
162162
// 1: Load SpRestLib via CDN
@@ -176,9 +176,14 @@ sprLib.user().info().then( objUser => (console.table ? console.table([objUser])
176176

177177
What makes a good library great? The ability to chain and group asynchronous operations!
178178

179-
SpRestLib not only provides a simple REST interface, it also delivers next-generation async operation handling.
179+
SpRestLib not only provides a simple REST interface, it also delivers next-generation
180+
async operation handling via [ES6 Promises](http://www.datchley.name/es6-promises/).
180181

181-
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.
182+
SharePoint applications frequently perform lots of operations (e.g.: read from many lists at startup)
183+
or perform sequential steps (e.g.: get an item, then do further operations depending upon the result).
184+
Until recently, using callbacks was the standard way to handle async completion, but with Promises
185+
(which all SpRestLib methods return) operations can be easily chained by using `then()`, making your code
186+
much easier to write and maintain.
182187

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

@@ -237,15 +242,11 @@ sprLib.user().info()
237242
## REST API Methods
238243
Returns the results of a given REST call to any [SharePoint REST API](https://msdn.microsoft.com/en-us/library/office/dn268594.aspx)
239244

240-
Use the `sprLib.rest()` interface to GET or PORT to any of the dozens of available SP REST API Endpoints.
245+
Use the `sprLib.rest()` interface to GET or POST to any of the dozens of available SP REST API Endpoints.
241246

242247
The available REST service endpoints can add Users to Groups, create columns in a List/Library, enumerate site properties
243248
and other super useful functions.
244249

245-
**Get Results**
246-
Calling the SharePoint REST APIs directly via AJAX calls will return results in different forms (some are `data.d` while others are `data.d.results`)
247-
whereas SpRestLib always returns consistent results in the form of array of objects with name/value pairs.
248-
249250
Syntax:
250251
`sprLib.rest(options)`
251252

0 commit comments

Comments
 (0)