<commit_before>angular.module(PKG.name + '.feature.foo')
  .controller('FooPlaygroundController',
    function ($scope, $q, mySessionStorage, myLocalStorage, mySettings) {

      // meta to the max!

      var solutions = [
        { n:'Session',  v:mySessionStorage },
        { n:'Local',    v:myLocalStorage },
        { n:'Settings', v:mySettings }
      ];

      $q.all(solutions.map(function(s){
        return s.v.get('test');
      }))
      .then(function(result){
        var s;
        for (var i = 0; i < result.length; i++) {
          s = solutions[i];
          $scope[s.n.toLowerCase()] = result[i];
          $scope['doSave'+s.n] = (function() {
            this.v.set('test', $scope[this.n.toLowerCase()]);
          }).bind(s);
        }
      });


    });<commit_msg>update playground pref key and document inline<commit_after>angular.module(PKG.name + '.feature.foo')
  .controller('FooPlaygroundController',
    function ($scope, $q, mySessionStorage, myLocalStorage, mySettings) {

      // meta to the max!

      var solutions = [
        { n:'Session',  v:mySessionStorage },
        { n:'Local',    v:myLocalStorage },
        { n:'Settings', v:mySettings }
      ];

      /*
        naming scheme for preferences:

        first component: "f" for feature
        second component: "foo" feature name
        last component(s): state the pref originate from
       */
      var PREF_KEY = 'f.foo.test-settings';

      $q.all(solutions.map(function(s){
        return s.v.get(PREF_KEY);
      }))
      .then(function(result){
        var s;
        for (var i = 0; i < result.length; i++) {
          s = solutions[i];
          $scope[s.n.toLowerCase()] = result[i];
          $scope['doSave'+s.n] = (function() {
            this.v.set(PREF_KEY, $scope[this.n.toLowerCase()]);
          }).bind(s);
        }
      });


    });
{'fraction_non_alphanumeric': 0.1648764769065521, 'fraction_numerical': 0.0010741138560687433, 'mean_word_length': 2.0946843853820596, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1767412', 'n_tokens_mistral': 594, 'n_tokens_neox': 585, 'n_words': 116}