<commit_before>var {createStore} = require('fluxible/addons')

var LayoutStore = createStore({
  storeName: 'LayoutStore',
  handlers: {
    'NAVIGATE_SUCCESS': 'closeMenu',
    'TOGGLE_LAYOUT_MENU': 'toggleMenu',
    'OPEN_LAYOUT_MENU': 'openMenu',
    'CLOSE_LAYOUT_MENU': 'closeMenu'
  },
  initialize: function () {
    this.openMenu = false
  },
  toggleMenu: function () {
    this.openMenu = !this.openMenu
    this.emitChange()
  },
  openMenu: function () {
    if (this.openMenu !== true) {
      this.openMenu = true
      this.emitChange()
    }
  },
  closeMenu: function () {
    if (this.openMenu !== false) {
      this.openMenu = false
      this.emitChange()
    }
  },
  getState: function () {
    return {
      openMenu: this.openMenu
    }
  },
  dehydrate: function () {
    return this.getState()
  },
  rehydrate: function (state) {
    this.openMenu = state.openMenu
  }
})

module.exports = LayoutStore<commit_msg>Add sidebar to LayoutStore<commit_after>var {createStore} = require('fluxible/addons'),
  Immutable = require('immutable')

var LayoutStore = createStore({
  storeName: 'LayoutStore',
  handlers: {
    'NAVIGATE_SUCCESS': 'closeSidebar',
    'TOGGLE_SIDEBAR': 'toggleSidebar',
    'CLOSE_SIDEBAR': 'closeSidebar',
    'OPEN_SIDEBAR': 'openSidebar'
  },
  initialize: function () {
    this.sidebar = Immutable.fromJS({
      open: false
    })
  },

  setSidebar: function (name, value) {
    var sidebar = this.sidebar.set(name, value)
    if (this.sidebar !== sidebar) {
      this.sidebar = sidebar
      this.emitChange()
    }
  },

  toggleSidebar: function () {
    this.setSidebar('open', !this.sidebar.get('open'))
  },
  openSidebar: function () {
    this.setSidebar('open', true)
  },
  closeSidebar: function () {
    this.setSidebar('open', false)
  },

  getSidebar: function () {
    return this.sidebar.toJS()
  },

  getState: function () {
    return {
      sidebar: this.getSidebar()
    }
  },

  dehydrate: function () {
    return this.getState()
  },

  rehydrate: function (state) {
    this.sidebar = Immutable.fromJS(state.sidebar)
  }
})

module.exports = LayoutStore
{'fraction_non_alphanumeric': 0.14733395696913001, 'fraction_numerical': 0.0, 'mean_word_length': 3.121387283236994, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2201079', 'n_tokens_mistral': 748, 'n_tokens_neox': 725, 'n_words': 131}