Skip to content

Instantly share code, notes, and snippets.

@Weiyuan-Lane
Created March 20, 2022 13:53
Show Gist options
  • Select an option

  • Save Weiyuan-Lane/b3a99b81ac63256e5e94f437b7acde66 to your computer and use it in GitHub Desktop.

Select an option

Save Weiyuan-Lane/b3a99b81ac63256e5e94f437b7acde66 to your computer and use it in GitHub Desktop.
async setAttributes(attrs: Object): Promise<void> {
return this.growthbookSingleton.then((growthbook: GrowthBook) => {
growthbook.setAttributes(attrs);
this.triggerUpdate();
})
}
async evalFeature<T extends FeatureValType>(featureKey: string): Promise<T | null> {
return this.growthbookSingleton.then((growthbook: GrowthBook) => {
const val = growthbook.evalFeature<T>(featureKey);
return val.value;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment