UNPKG

310 BJavaScriptView Raw
1import { addons } from '@storybook/addons';
2import EVENTS, { ADDON_ID } from './constants';
3addons.register(ADDON_ID, api => {
4 const channel = addons.getChannel();
5 channel.on(EVENTS.REQUEST, ({
6 kind,
7 name
8 }) => {
9 const id = api.storyId(kind, name);
10 api.emit(EVENTS.RECEIVE, id);
11 });
12});
\No newline at end of file