Grabbed dndbeyond's source code
``` ~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js ```
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { DEFAULT_FEATURE_FLAG_INFO, FeatureFlagInfoUtils, FeatureFlagEnum, } from '../engine/FeatureFlagInfo';
|
||||
export class FeatureFlagManager {
|
||||
// TODO: let make this optional and just get it with the rules engine config...
|
||||
constructor(featureFlagInfo) {
|
||||
this.featureFlagInfo = DEFAULT_FEATURE_FLAG_INFO;
|
||||
this.FLAGS = FeatureFlagEnum;
|
||||
/**
|
||||
*
|
||||
* @param flag the name of a flag
|
||||
* @returns its current value
|
||||
*
|
||||
* Try featureFlagManager.getFlag(featureFlagManager.NAME_OF_FLAG)
|
||||
*/
|
||||
this.getFlag = (flag) => {
|
||||
return FeatureFlagInfoUtils.getFeatureFlagInfoValue(flag, this.featureFlagInfo);
|
||||
};
|
||||
/**
|
||||
*
|
||||
* @param featureFlagInfo the new feature flags
|
||||
*/
|
||||
this.update = (featureFlagInfo) => {
|
||||
this.featureFlagInfo = featureFlagInfo;
|
||||
};
|
||||
this.featureFlagInfo = featureFlagInfo;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user