Skip to content

Commit 06b137d

Browse files
author
Claudiu Andrei
committed
Throttle the digest when object observe is not present to about 4/sec
1 parent 397619d commit 06b137d

File tree

3 files changed

+40
-38
lines changed

3 files changed

+40
-38
lines changed

dist/js-data-angular.js

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
if(typeof exports === 'object' && typeof module === 'object')
1212
module.exports = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }()));
1313
else if(typeof define === 'function' && define.amd)
14-
define(["js-data", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__) {
15-
return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, root["axios"]);
14+
define(["js-data", "angular"], function webpackLoadOptionalExternalModuleAmd(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_4__) {
15+
return factory(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_4__, root["axios"]);
1616
});
1717
else if(typeof exports === 'object')
1818
exports["jsDataAngularModuleName"] = factory(require("js-data"), require("angular"), (function webpackLoadOptionalExternalModule() { try { return require("axios"); } catch(e) {} }()));
1919
else
2020
root["jsDataAngularModuleName"] = factory(root["JSData"], root["angular"], root["axios"]);
21-
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_5__) {
21+
})(this, function(__WEBPACK_EXTERNAL_MODULE_1__, __WEBPACK_EXTERNAL_MODULE_4__, __WEBPACK_EXTERNAL_MODULE_3__) {
2222
return /******/ (function(modules) { // webpackBootstrap
2323
/******/ // The module cache
2424
/******/ var installedModules = {};
@@ -69,8 +69,8 @@ return /******/ (function(modules) { // webpackBootstrap
6969

7070
/*jshint loopfunc:true*/
7171
var JSData = __webpack_require__(1);
72-
var DSHttpAdapter = __webpack_require__(4);
73-
var angular = __webpack_require__(2);
72+
var DSHttpAdapter = __webpack_require__(2);
73+
var angular = __webpack_require__(4);
7474

7575
var DSUtils = JSData.DSUtils;
7676
var DSErrors = JSData.DSErrors;
@@ -104,7 +104,7 @@ return /******/ (function(modules) { // webpackBootstrap
104104
var Adapter = undefined;
105105

106106
try {
107-
Adapter = __webpack_require__(3)(adapter.project);
107+
Adapter = __webpack_require__(5)(adapter.project);
108108
} catch (e) {}
109109

110110
if (!Adapter) {
@@ -287,7 +287,9 @@ return /******/ (function(modules) { // webpackBootstrap
287287
// Hook into the digest loop
288288
if (typeof Object.observe !== 'function' || typeof Array.observe !== 'function') {
289289
$rootScope.$watch(function () {
290-
return store.observe.Platform.performMicrotaskCheckpoint();
290+
return new Date().getTime() >> 8;
291+
}, function () {
292+
return store.digest();
291293
});
292294
}
293295

@@ -315,37 +317,12 @@ return /******/ (function(modules) { // webpackBootstrap
315317

316318
/***/ },
317319
/* 1 */
318-
/***/ function(module, exports, __webpack_require__) {
320+
/***/ function(module, exports) {
319321

320322
module.exports = __WEBPACK_EXTERNAL_MODULE_1__;
321323

322324
/***/ },
323325
/* 2 */
324-
/***/ function(module, exports, __webpack_require__) {
325-
326-
module.exports = __WEBPACK_EXTERNAL_MODULE_2__;
327-
328-
/***/ },
329-
/* 3 */
330-
/***/ function(module, exports, __webpack_require__) {
331-
332-
var map = {};
333-
function webpackContext(req) {
334-
return __webpack_require__(webpackContextResolve(req));
335-
};
336-
function webpackContextResolve(req) {
337-
return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
338-
};
339-
webpackContext.keys = function webpackContextKeys() {
340-
return Object.keys(map);
341-
};
342-
webpackContext.resolve = webpackContextResolve;
343-
module.exports = webpackContext;
344-
webpackContext.id = 3;
345-
346-
347-
/***/ },
348-
/* 4 */
349326
/***/ function(module, exports, __webpack_require__) {
350327

351328
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
@@ -356,7 +333,7 @@ return /******/ (function(modules) { // webpackBootstrap
356333
var axios = null;
357334

358335
try {
359-
axios = __webpack_require__(5);
336+
axios = __webpack_require__(3);
360337
} catch (e) {}
361338

362339
var DSUtils = JSData.DSUtils;
@@ -674,12 +651,37 @@ return /******/ (function(modules) { // webpackBootstrap
674651

675652
module.exports = DSHttpAdapter;
676653

654+
/***/ },
655+
/* 3 */
656+
/***/ function(module, exports) {
657+
658+
if(typeof __WEBPACK_EXTERNAL_MODULE_3__ === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;}
659+
module.exports = __WEBPACK_EXTERNAL_MODULE_3__;
660+
661+
/***/ },
662+
/* 4 */
663+
/***/ function(module, exports) {
664+
665+
module.exports = __WEBPACK_EXTERNAL_MODULE_4__;
666+
677667
/***/ },
678668
/* 5 */
679669
/***/ function(module, exports, __webpack_require__) {
680670

681-
if(typeof __WEBPACK_EXTERNAL_MODULE_5__ === 'undefined') {var e = new Error("Cannot find module \"axios\""); e.code = 'MODULE_NOT_FOUND'; throw e;}
682-
module.exports = __WEBPACK_EXTERNAL_MODULE_5__;
671+
var map = {};
672+
function webpackContext(req) {
673+
return __webpack_require__(webpackContextResolve(req));
674+
};
675+
function webpackContextResolve(req) {
676+
return map[req] || (function() { throw new Error("Cannot find module '" + req + "'.") }());
677+
};
678+
webpackContext.keys = function webpackContextKeys() {
679+
return Object.keys(map);
680+
};
681+
webpackContext.resolve = webpackContextResolve;
682+
module.exports = webpackContext;
683+
webpackContext.id = 5;
684+
683685

684686
/***/ }
685687
/******/ ])

0 commit comments

Comments
 (0)