@arms/rum-core 0.0.38 → 0.0.39

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.
@@ -9,6 +9,7 @@ export default abstract class Reporter {
9
9
  protected eventQueue: RumEvent[];
10
10
  protected ctx: IContext;
11
11
  private timer;
12
+ private _init;
12
13
  getReportCfg(): {
13
14
  flushTime?: number;
14
15
  maxEventCount?: number;
@@ -15,6 +15,7 @@ var Reporter = /*#__PURE__*/function () {
15
15
  this.eventQueue = [];
16
16
  this.ctx = void 0;
17
17
  this.timer = void 0;
18
+ this._init = false;
18
19
  }
19
20
  var _proto = Reporter.prototype;
20
21
  _proto.getReportCfg = function getReportCfg() {
@@ -33,7 +34,10 @@ var Reporter = /*#__PURE__*/function () {
33
34
  _proto.report = function report(ctx) {
34
35
  var _this = this;
35
36
  this.ctx = ctx;
36
- this.init(ctx);
37
+ if (!this._init) {
38
+ this.init(ctx);
39
+ this._init = true;
40
+ }
37
41
  clearTimeout(this.timer);
38
42
  this.pushToQueue();
39
43
  var reportConfig = this.getReportCfg();
@@ -9,6 +9,7 @@ export default abstract class Reporter {
9
9
  protected eventQueue: RumEvent[];
10
10
  protected ctx: IContext;
11
11
  private timer;
12
+ private _init;
12
13
  getReportCfg(): {
13
14
  flushTime?: number;
14
15
  maxEventCount?: number;
@@ -19,6 +19,7 @@ var Reporter = exports["default"] = /*#__PURE__*/function () {
19
19
  this.eventQueue = [];
20
20
  this.ctx = void 0;
21
21
  this.timer = void 0;
22
+ this._init = false;
22
23
  }
23
24
  var _proto = Reporter.prototype;
24
25
  _proto.getReportCfg = function getReportCfg() {
@@ -37,7 +38,10 @@ var Reporter = exports["default"] = /*#__PURE__*/function () {
37
38
  _proto.report = function report(ctx) {
38
39
  var _this = this;
39
40
  this.ctx = ctx;
40
- this.init(ctx);
41
+ if (!this._init) {
42
+ this.init(ctx);
43
+ this._init = true;
44
+ }
41
45
  clearTimeout(this.timer);
42
46
  this.pushToQueue();
43
47
  var reportConfig = this.getReportCfg();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arms/rum-core",
3
- "version": "0.0.38",
3
+ "version": "0.0.39",
4
4
  "description": "arms rum javascript sdk core",
5
5
  "author": "guangli.fj <guangli.fj@alibaba-inc.com>",
6
6
  "license": "ISC",