Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo channel stubbing - causes NPM version errors to fail silently #1494

Merged
merged 5 commits into from
Jul 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/addons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
function channelError() {
throw new Error(
'Accessing nonexistent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel'
);
}

export class AddonStore {
constructor() {
this.loaders = {};
this.panels = {};
this.channel = { on() {}, emit() {} };
// this.channel should get overwritten by setChannel if package versions are
// correct and AddonStore is a proper singleton. If not, throw an error.
this.channel = { on: channelError, emit: channelError };
this.preview = null;
this.database = null;
}
Expand Down