Mailspring/internal_packages/plugins/lib/tabs-store.jsx
Jackie Luo 6e07dce03c 🎨(preferences): Updates preferences to look prettier
Summary:
Adds new redesigned preferences with horizontal tab bar and refactored code.

Converts Preferences, Plugins, and a few components to ES6.

Test Plan: Tested locally.

Reviewers: evan, bengotow

Reviewed By: bengotow

Subscribers: juan

Differential Revision: https://phab.nylas.com/D2818
2016-04-01 14:01:26 -07:00

29 lines
498 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;