monkey-front-core 0.0.76 → 0.0.80
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/esm2020/lib/core/services/config/monkeyecx-feature-toggle.service.mjs +5 -24
- package/fesm2015/monkey-front-core.mjs +4 -23
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +4 -23
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/monkey-front-core-0.0.80.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.76.tgz +0 -0
|
@@ -2474,67 +2474,48 @@ class MonkeyEcxFeatureToggleService {
|
|
|
2474
2474
|
// not to do
|
|
2475
2475
|
}
|
|
2476
2476
|
getAllFlags() {
|
|
2477
|
-
|
|
2477
|
+
if (!this)
|
|
2478
|
+
return;
|
|
2478
2479
|
this.flags = this.ldClient?.allFlags();
|
|
2479
|
-
console.log('11');
|
|
2480
2480
|
this.flagSubject$.next(true);
|
|
2481
|
-
console.log('12');
|
|
2482
2481
|
}
|
|
2483
2482
|
identify(config, environment) {
|
|
2484
|
-
console.log('1');
|
|
2485
|
-
console.log(this);
|
|
2486
2483
|
if (config) {
|
|
2487
|
-
console.log('2');
|
|
2488
2484
|
const email = 'monkey@monkey.exchange';
|
|
2489
|
-
console.log('3');
|
|
2490
2485
|
const user = {
|
|
2491
2486
|
email,
|
|
2492
2487
|
key: `${config.program?.token}#${email}`,
|
|
2493
2488
|
};
|
|
2494
|
-
console.log('4');
|
|
2495
2489
|
if (!this.ldClient) {
|
|
2496
|
-
console.log('5');
|
|
2497
2490
|
this.ldClient = initialize(environment.launchDarklyClientSideID, user, {
|
|
2498
2491
|
streaming: true,
|
|
2499
2492
|
disableSyncEventPost: true,
|
|
2500
2493
|
sendEvents: false,
|
|
2501
2494
|
diagnosticOptOut: true,
|
|
2502
2495
|
});
|
|
2503
|
-
|
|
2504
|
-
this.ldClient.on('
|
|
2505
|
-
console.log('7');
|
|
2506
|
-
this.ldClient.on('ready', this.getAllFlags.bind(this));
|
|
2507
|
-
console.log('8');
|
|
2496
|
+
this.ldClient.on('change', this.getAllFlags.bind(this, 'change'));
|
|
2497
|
+
this.ldClient.on('ready', this.getAllFlags.bind(this, 'ready'));
|
|
2508
2498
|
}
|
|
2509
2499
|
else {
|
|
2510
|
-
console.log('9');
|
|
2511
2500
|
this.ldClient.identify(user, undefined, this.getAllFlags);
|
|
2512
2501
|
}
|
|
2513
|
-
console.log(this);
|
|
2514
2502
|
}
|
|
2515
2503
|
}
|
|
2516
2504
|
apply(configSubject$, environment) {
|
|
2517
|
-
console.log('13');
|
|
2518
2505
|
if (environment.launchDarklyClientSideID) {
|
|
2519
|
-
console.log('14');
|
|
2520
2506
|
configSubject$.subscribe((config) => {
|
|
2521
|
-
console.log('15');
|
|
2522
2507
|
this.identify(config, environment);
|
|
2523
2508
|
});
|
|
2524
2509
|
}
|
|
2525
2510
|
else {
|
|
2526
|
-
console.log('16');
|
|
2527
2511
|
this.flagSubject$.next(true);
|
|
2528
2512
|
}
|
|
2529
2513
|
}
|
|
2530
2514
|
get onFlags() {
|
|
2531
|
-
console.log('17');
|
|
2532
2515
|
return this.flagSubject$.asObservable();
|
|
2533
2516
|
}
|
|
2534
2517
|
getFlag(flag) {
|
|
2535
|
-
console.log('18');
|
|
2536
2518
|
const flagValue = this.flags?.[flag];
|
|
2537
|
-
console.log('19');
|
|
2538
2519
|
return MonkeyUtils.persistNullEmptyUndefined(flagValue) ? flagValue : null;
|
|
2539
2520
|
}
|
|
2540
2521
|
}
|