mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
FIX provider
This commit is contained in:
parent
0994524da1
commit
cb73f0f1d5
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user