1 | import { addons } from '@storybook/addons';
|
2 | import EVENTS, { ADDON_ID } from './constants';
|
3 | addons.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 |