
export default function *() {
	// Get current store from state or else set a default if it exists
	var store = this.getState('Tabs', {
		'name': 'components'
	});

	this.on('store.Tabs.setTabs', function *(currentTab) {
		var store = this.getState('Tabs');

		if (currentTab) {
			store.name = currentTab;

			if (currentTab === 'components') {
				$('#tabs').prop('checked', false);
			}

			if (currentTab === 'codes') {
				$('#tabs').prop('checked', true);
				$('#toolBar').removeClass('hide');
			}
		}

		// Notify view that time to update
		this.dispatch('store.Tabs', 'change');
	});
};