@bbn/bbn 1.0.321 → 1.0.323
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.
package/dist/fn/ajax/stream.js
CHANGED
|
@@ -57,13 +57,16 @@ export default function stream(url, success, data, failure, abort) {
|
|
|
57
57
|
reader_1.read().then(function pump(_a) {
|
|
58
58
|
var done = _a.done, value = _a.value;
|
|
59
59
|
if (done) {
|
|
60
|
+
bbn.fn.log(["STREAM DONE", value, data]);
|
|
60
61
|
// Do something with last chunk of data then exit reader
|
|
61
62
|
_deleteLoader(requestId, data);
|
|
62
63
|
defaultEndLoadingFunction(url, tst, data);
|
|
63
64
|
return;
|
|
64
65
|
}
|
|
66
|
+
bbn.fn.log(["STREAM SUCCESS IS FN: " + isFn_1]);
|
|
65
67
|
if (isFn_1) {
|
|
66
68
|
var res = arrayBuffer2String(value).trim();
|
|
69
|
+
bbn.fn.log(["STREAM RESULT", res]);
|
|
67
70
|
if (res) {
|
|
68
71
|
try {
|
|
69
72
|
success(JSON.parse(res));
|
|
@@ -8,13 +8,17 @@
|
|
|
8
8
|
* ```
|
|
9
9
|
* @memberof bbn.fn
|
|
10
10
|
* @param {String} name
|
|
11
|
+
* @param {Boolean} secs
|
|
11
12
|
* @returns {Number}
|
|
12
13
|
*/
|
|
13
|
-
export default function stopChrono(name) {
|
|
14
|
+
export default function stopChrono(name, secs) {
|
|
14
15
|
if (this.constructor.chronos[name || 'default']) {
|
|
15
16
|
var now = bbn.fn.microtimestamp();
|
|
16
17
|
var diff = now - this.constructor.chronos[name || 'default'];
|
|
17
18
|
delete this.constructor.chronos[name || 'default'];
|
|
19
|
+
if (secs) {
|
|
20
|
+
diff = Math.round(diff) / 1000;
|
|
21
|
+
}
|
|
18
22
|
return diff;
|
|
19
23
|
}
|
|
20
24
|
throw Error("No chrono with name " + (name || 'default'));
|