@ninetailed/experience.js 3.0.0-beta.46 → 3.0.0

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/index.cjs CHANGED
@@ -3253,20 +3253,18 @@ class Ninetailed {
3253
3253
  throw error;
3254
3254
  }
3255
3255
  });
3256
- this.reset = () => {
3257
- this.onIsInitialized(() => {
3258
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3259
- // @ts-ignore
3260
- this.instance.plugins[PLUGIN_NAME].reset();
3261
- });
3262
- };
3263
- this.debug = enabled => {
3264
- this.onIsInitialized(() => {
3265
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3266
- // @ts-ignore
3267
- this.instance.plugins[PLUGIN_NAME].debug(enabled);
3268
- });
3269
- };
3256
+ this.reset = () => __awaiter(this, void 0, void 0, function* () {
3257
+ yield this.waitUntilInitialized();
3258
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3259
+ // @ts-ignore
3260
+ this.instance.plugins[PLUGIN_NAME].reset();
3261
+ });
3262
+ this.debug = enabled => __awaiter(this, void 0, void 0, function* () {
3263
+ yield this.waitUntilInitialized();
3264
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3265
+ // @ts-ignore
3266
+ this.instance.plugins[PLUGIN_NAME].debug(enabled);
3267
+ });
3270
3268
  this.onProfileChange = cb => {
3271
3269
  cb(this.profileState);
3272
3270
  return this.instance.on(PROFILE_CHANGE, ({
@@ -3293,6 +3291,7 @@ class Ninetailed {
3293
3291
  onIsInitialized();
3294
3292
  } else {
3295
3293
  const detachOnReadyListener = this.instance.on('ready', () => {
3294
+ this.isInitialized = true;
3296
3295
  onIsInitialized();
3297
3296
  detachOnReadyListener();
3298
3297
  });
package/index.js CHANGED
@@ -3240,20 +3240,18 @@ class Ninetailed {
3240
3240
  throw error;
3241
3241
  }
3242
3242
  });
3243
- this.reset = () => {
3244
- this.onIsInitialized(() => {
3245
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3246
- // @ts-ignore
3247
- this.instance.plugins[PLUGIN_NAME].reset();
3248
- });
3249
- };
3250
- this.debug = enabled => {
3251
- this.onIsInitialized(() => {
3252
- // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3253
- // @ts-ignore
3254
- this.instance.plugins[PLUGIN_NAME].debug(enabled);
3255
- });
3256
- };
3243
+ this.reset = () => __awaiter(this, void 0, void 0, function* () {
3244
+ yield this.waitUntilInitialized();
3245
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3246
+ // @ts-ignore
3247
+ this.instance.plugins[PLUGIN_NAME].reset();
3248
+ });
3249
+ this.debug = enabled => __awaiter(this, void 0, void 0, function* () {
3250
+ yield this.waitUntilInitialized();
3251
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
3252
+ // @ts-ignore
3253
+ this.instance.plugins[PLUGIN_NAME].debug(enabled);
3254
+ });
3257
3255
  this.onProfileChange = cb => {
3258
3256
  cb(this.profileState);
3259
3257
  return this.instance.on(PROFILE_CHANGE, ({
@@ -3280,6 +3278,7 @@ class Ninetailed {
3280
3278
  onIsInitialized();
3281
3279
  } else {
3282
3280
  const detachOnReadyListener = this.instance.on('ready', () => {
3281
+ this.isInitialized = true;
3283
3282
  onIsInitialized();
3284
3283
  detachOnReadyListener();
3285
3284
  });
@@ -34,8 +34,8 @@ export declare class Ninetailed implements NinetailedInstance {
34
34
  trackHasSeenComponent: TrackHasSeenComponent;
35
35
  trackHasSeenExperience: TrackHasSeenExperience;
36
36
  identify: (uid: string, traits?: Traits, options?: EventFunctionOptions) => Promise<import("./types").FlushResult>;
37
- reset: () => void;
38
- debug: (enabled: boolean) => void;
37
+ reset: () => Promise<void>;
38
+ debug: (enabled: boolean) => Promise<void>;
39
39
  onProfileChange: (cb: OnProfileChangeCallback) => import("analytics").DetachListeners;
40
40
  onIsInitialized: (onIsInitialized: OnIsInitializedCallback) => void;
41
41
  private waitUntilInitialized;
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "@ninetailed/experience.js",
3
- "version": "3.0.0-beta.46",
3
+ "version": "3.0.0",
4
4
  "module": "./index.js",
5
5
  "main": "./index.cjs",
6
6
  "type": "module",
7
7
  "types": "./index.d.ts",
8
8
  "dependencies": {
9
- "@ninetailed/experience.js-shared": "3.0.0-beta.46",
9
+ "@ninetailed/experience.js-shared": "3.0.0",
10
10
  "analytics": "0.8.1",
11
11
  "lodash": "4.17.21",
12
12
  "murmurhash-js": "1.0.0",
13
- "@ninetailed/experience.js-plugin-analytics": "3.0.0-beta.46"
13
+ "@ninetailed/experience.js-plugin-analytics": "3.0.0"
14
14
  },
15
15
  "peerDependencies": {}
16
16
  }