{"size": 992, "ext": "js", "max_stars_repo_path": "mlcomp/board/frontend/src/lib/persist.js", "max_stars_repo_name": "korepwx/mlcomp", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "mlcomp/board/frontend/src/lib/persist.js", "max_issues_repo_name": "korepwx/mlcomp", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "mlcomp/board/frontend/src/lib/persist.js", "max_forks_repo_name": "korepwx/mlcomp", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 23.0697674419, "max_line_length": 65, "alphanum_fraction": 0.6048387097}
import { ALL_STATUS } from './api.js';
import store from 'store';

/** Make a config proxy from the specified object. */
function makeConfig(obj) {
  const ret = {};
  for (const key of Object.keys(obj)) {
    const defaultValue = obj[key];
    Object.defineProperty(ret, key, {
      get: () => {
        const ret = store.get(key);
        if (typeof ret === 'undefined')
          return defaultValue;
        return ret;
      },
      set: (value) => {
        store.set(key, value);
      }
    });
  }
  return ret;
} // makeConfig

class PersistStorage {
  constructor() {
    this._boardConfig = makeConfig({
      // Whether or not the side panel should be open by default?
      sidePanelOpen: true,

      // The query string on the storage groups
      queryString: '',

      // The status filter on the storage groups
      statusFilter: ALL_STATUS
    });
  }

  get boardConfig() { return this._boardConfig; }
}

const persist = new PersistStorage();
export default persist;
