# All files / src/stores MarkdownEditorTabsInteractionStore.js

75% Statements 6/8
100% Branches 0/0
33.33% Functions 1/3
75% Lines 6/8

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    204x
    4x

    4x

    4x
    4x

    4x
     var Reflux = require('reflux');
    var MarkdownEditorActions = require('../actions/MarkdownEditorActions');

    var MarkdownEditorTabsInteractionStore = Reflux.createStore({
      init: function() {
        this.listenTo(MarkdownEditorActions.clickPreviewTab, this.handleClickPreviewTab);
        this.listenTo(MarkdownEditorActions.clickEditorTab, this.handleClickEditorTab);
      },

      handleClickPreviewTab: function() {
        this.trigger({activeTab: 1});
      },

      handleClickEditorTab: function() {
        this.trigger({activeTab: 0});
      }
    });

    module.exports = MarkdownEditorTabsInteractionStore;