总体情况是,我不想让消费者做rib子/un子。 我希望他们叫SapBooleanFeature Toggle(toggleKey:string)并返回羊毛。
getBooleanFeatureToggleAsObservable(toggleKey: string): Observable<boolean> {
return from(this.getBooleanFeatureToggleAsPromise(toggleKey));
}
public async getMyFlag(toggleKey: string): Promise<boolean> {
let flag = false;
const sub = await this.getBooleanFeatureToggleAsObservable(toggleKey).subscribe({
next: (featureEnabled: boolean) => {
console.log( featureEnabled , featureEnabled);
flag = featureEnabled;
},
error: (error: any) => console.error(error)
});
return flag;
}
public getBooleanFeatureToggle(toggleKey: string) {
const myFlag = this.getMyFlag(toggleKey);
console.log( myFlag , myFlag);
return false;
}