You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jan 18, 2021. It is now read-only.
What makes a good library great? The ability to chain and group asynchronous operations!
178
178
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/).
180
181
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.
182
187
183
188
See the [Async Operations via Promises](#async-operations-via-promises) section for more information and examples.
184
189
@@ -237,15 +242,11 @@ sprLib.user().info()
237
242
## REST API Methods
238
243
Returns the results of a given REST call to any [SharePoint REST API](https://msdn.microsoft.com/en-us/library/office/dn268594.aspx)
239
244
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.
241
246
242
247
The available REST service endpoints can add Users to Groups, create columns in a List/Library, enumerate site properties
243
248
and other super useful functions.
244
249
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.
0 commit comments