UNPKG

912 BJavaScriptView Raw
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
10/* eslint no-underscore-dangle: 0 */
11var ConfigApi = function ConfigApi(_ref) {
12 var _this = this;
13
14 var storyStore = _ref.storyStore;
15
16 _classCallCheck(this, ConfigApi);
17
18 this._storyStore = void 0;
19
20 this.configure = function (loaders, module) {
21 var showDeprecationWarning = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
22
23 _this._storyStore.startConfiguring();
24
25 try {
26 loaders();
27
28 _this._storyStore.clearError();
29 } catch (err) {
30 _this._storyStore.setError(err);
31 }
32
33 _this._storyStore.finishConfiguring();
34 };
35
36 this._storyStore = storyStore;
37};
38
39exports.default = ConfigApi;
\No newline at end of file