FIX provider

This commit is contained in:
Norbert de Langen 2019-03-13 16:12:16 +01:00
parent 0994524da1
commit cb73f0f1d5
2 changed files with 14 additions and 6 deletions

View File

@ -6,13 +6,21 @@ import Events from '@storybook/core-events';
export default class ReactProvider extends Provider {
constructor() {
super();
this.channel = createChannel({ page: 'manager' });
addons.setChannel(this.channel);
this.channel.emit(Events.CHANNEL_CREATED);
const channel = createChannel({ page: 'manager' });
addons.setChannel(this.channel);
channel.emit(Events.CHANNEL_CREATED);
this.addons = addons;
this.channel = channel;
}
getElements(type) {
return this.addons.getElements(type);
}
handleAPI(api) {
addons.loadAddons(api);
this.addons.loadAddons(api);
}
}

View File

@ -1,6 +1,6 @@
export default class Provider {
renderPreview() {
throw new Error('Provider.renderPreview() is not implemented!');
getElements() {
throw new Error('Provider.getElements() is not implemented!');
}
handleAPI() {