Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
channel = createChannel({ page: 'preview' });
addons.setChannel(channel);
}
}
let storyStore;
let clientApi;
if (typeof window !== 'undefined' && window.__STORYBOOK_CLIENT_API__) {
clientApi = window.__STORYBOOK_CLIENT_API__;
// eslint-disable-next-line no-underscore-dangle
storyStore = clientApi._storyStore;
} else {
storyStore = new StoryStore({ channel });
clientApi = new ClientApi({ storyStore, decorateStory });
}
const { clearDecorators } = clientApi;
const configApi = new ConfigApi({ clearDecorators, storyStore, channel, clientApi });
return {
configApi,
storyStore,
channel,
clientApi,
showMain,
showError,
showException,
};
};
})();