Skip to content

Instantly share code, notes, and snippets.

@mizrael
Created March 6, 2018 18:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mizrael/d8f5898becc21274f0cc2120402d4dc3 to your computer and use it in GitHub Desktop.
Save mizrael/d8f5898becc21274f0cc2120402d4dc3 to your computer and use it in GitHub Desktop.
Feature Gating - check the gates
interface IFeatureService{
isEnabled(featureName:string):boolean;
}
export class Foo implements IFoo{
constructor(private readonly featureService:IFeatureService){}
public bar(){
if(this.featureService.isEnabled("feature-x")){
/*.......*/
}else{
/*.......*/
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment