Mailspring/internal_packages/plugins/lib/tabs-store.coffee

23 lines
377 B
CoffeeScript
Raw Normal View History

_ = require 'underscore'
Reflux = require 'reflux'
PluginsActions = require './plugins-actions'
module.exports =
TabsStore = Reflux.createStore
init: ->
@_tabIndex = 0
@listenTo(PluginsActions.selectTabIndex, @_onTabIndexChanged)
# Getters
tabIndex: ->
@_tabIndex
# Action Handlers
_onTabIndexChanged: (idx) ->
@_tabIndex = idx
@trigger(@)