'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.init = init;

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _storybookAddons = require('@kadira/storybook-addons');

var _storybookAddons2 = _interopRequireDefault(_storybookAddons);

var _shared = require('../shared');

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// init function will be executed once when the storybook loads for the
// first time. This is a good place to add channel listeners and panels.
function init() {
  _storybookAddons2.default.register(_shared.ADDON_ID, function (api) {
    var channel = _storybookAddons2.default.getChannel();
    channel.on(_shared.EVENT_ID, function (data) {
      api.setOptions(data.options);
    });
  });
}