Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setPath({ storyId, viewMode });
});
// Handle keyboard shortcuts
window.onkeydown = event => {
if (!focusInInput(event)) {
// We have to pick off the keys of the event that we need on the other side
const { altKey, ctrlKey, metaKey, shiftKey, key, code, keyCode } = event;
channel.emit(Events.PREVIEW_KEYDOWN, {
event: { altKey, ctrlKey, metaKey, shiftKey, key, code, keyCode },
});
}
};
}
storyStore.on(Events.STORY_INIT, () => {
const { storyId, viewMode } = initializePath();
storyStore.setSelection({ storyId, viewMode });
});
storyStore.on(Events.STORY_RENDER, renderUI);
if (typeof window !== 'undefined') {
window.__STORYBOOK_CLIENT_API__ = clientApi;
window.__STORYBOOK_ADDONS_CHANNEL__ = channel; // may not be defined
}
let previousExports = {};
const loadStories = req => () => {
req.keys().forEach(filename => {
const fileExports = req(filename);
_renderMain() {
// do initial render of story
this._storyStore.emit(Events.STORY_INIT);
}