Created
March 6, 2018 18:14
-
-
Save mizrael/d8f5898becc21274f0cc2120402d4dc3 to your computer and use it in GitHub Desktop.
Feature Gating - check the gates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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