Skip to content

Commit

Permalink
Merge pull request #1494 from storybooks/1486-undo-channel-stubbing
Browse files Browse the repository at this point in the history
Undo channel stubbing - causes NPM version errors to fail silently
  • Loading branch information
shilman committed Jul 22, 2017
2 parents 48e1155 + ee0e3cb commit d63af0d
Showing 1 changed file with 9 additions and 1 deletion.
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

0 comments on commit d63af0d

Please sign in to comment.