Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Our ViewModel will check very early on if it should show the Spending Analysis Widget or not.
- public override void OnAppearing()
- {
- ShowSpendingAnalysis = _featureFlagService.Can(Features.CanSeeSpendingAnalysis);
- }
- ...
- // This method lives in a FeatureFlagService implementation. Remember to always keep your ViewModels clean!
- public bool Can(string id)
- {
- if (_client == null) Initialize();
- var results = _client.BoolVariation(id);
- // Logging would be good
- Console.WriteLine($"Feature {id} is {results} for user {_user.Name} ({_user.Key})");
- return results;
- }
Add Comment
Please, Sign In to add comment