gd-sprest 9.4.7 → 9.4.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,29 +2,36 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.WebWorker = WebWorker;
4
4
  // Web Worker
5
- function WebWorker(callback, interval) {
6
- var _this = this;
7
- if (interval === void 0) { interval = 1000; }
8
- // Create the worker process
9
- var blob = new Blob([WorkerCode(interval)], { type: "application/javascript" });
10
- var worker = new Worker(URL.createObjectURL(blob));
11
- // Set the callback method
12
- worker.onmessage = function () {
13
- // Call the callback method
14
- callback();
15
- };
16
- // Watch the unload event to stop the loop
17
- window.addEventListener("beforeunload", function () {
18
- // Stop the loop
19
- _this.stop();
20
- _this._worker.terminate();
21
- });
5
+ var _WebWorker = /** @class */ (function () {
6
+ // Constructor
7
+ function _WebWorker(callback, interval) {
8
+ if (interval === void 0) { interval = 1000; }
9
+ var _this = this;
10
+ this._worker = null;
11
+ // Create the worker process
12
+ var blob = new Blob([WorkerCode(interval)], { type: "application/javascript" });
13
+ this._worker = new Worker(URL.createObjectURL(blob));
14
+ // Set the callback method
15
+ this._worker.onmessage = function () {
16
+ // Call the callback method
17
+ callback();
18
+ };
19
+ // Watch the unload event to stop the loop
20
+ window.addEventListener("beforeunload", function () {
21
+ // Stop the loop
22
+ _this.stop();
23
+ _this._worker.terminate();
24
+ });
25
+ }
22
26
  // Starts the loop
23
- var start = function () { _this._worker.postMessage("start"); };
27
+ _WebWorker.prototype.start = function () { this._worker.postMessage("start"); };
24
28
  // Stops the loop
25
- var stop = function () { _this._worker.postMessage("stop"); };
26
- // Return the public methods
27
- return { start: start, stop: stop };
29
+ _WebWorker.prototype.stop = function () { this._worker.postMessage("stop"); };
30
+ return _WebWorker;
31
+ }());
32
+ function WebWorker(callback, interval) {
33
+ if (interval === void 0) { interval = 1000; }
34
+ return new _WebWorker(callback, interval);
28
35
  }
29
36
  // The worker code
30
37
  function WorkerCode(interval) {
package/build/rest.js CHANGED
@@ -9,7 +9,7 @@ var sptypes_1 = require("./sptypes");
9
9
  * SharePoint REST Library
10
10
  */
11
11
  exports.$REST = {
12
- __ver: 9.47,
12
+ __ver: 9.49,
13
13
  AppContext: function (siteUrl) { return Lib.Site.getAppContext(siteUrl); },
14
14
  Apps: Lib.Apps,
15
15
  ContextInfo: Lib.ContextInfo,