Mailspring/app/internal_packages_disabled/plugins/lib/tabs-store.jsx
2017-09-26 11:33:08 -07:00

25 lines
495 B
JavaScript

import Reflux from 'reflux';
import PluginsActions from './plugins-actions';
const TabsStore = Reflux.createStore({
init: function init() {
this._tabIndex = 0;
this.listenTo(PluginsActions.selectTabIndex, this._onTabIndexChanged);
},
// Getters
tabIndex: function tabIndex() {
return this._tabIndex;
},
// Action Handlers
_onTabIndexChanged: function _onTabIndexChanged(idx) {
this._tabIndex = idx;
this.trigger(this);
},
});
export default TabsStore;