Guest User

Untitled

a guest
Feb 16th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. // Our ViewModel will check very early on if it should show the Spending Analysis Widget or not.
  2. public override void OnAppearing()
  3. {
  4. ShowSpendingAnalysis = _featureFlagService.Can(Features.CanSeeSpendingAnalysis);
  5. }
  6. ...
  7.  
  8. // This method lives in a FeatureFlagService implementation. Remember to always keep your ViewModels clean!
  9. public bool Can(string id)
  10. {
  11. if (_client == null) Initialize();
  12.  
  13. var results = _client.BoolVariation(id);
  14. // Logging would be good
  15. Console.WriteLine($"Feature {id} is {results} for user {_user.Name} ({_user.Key})");
  16. return results;
  17. }
Add Comment
Please, Sign In to add comment