Skip to content
This repository has been archived by the owner on May 16, 2024. It is now read-only.

Commit

Permalink
Merge pull request #2 from AlmarAubel/patch-1
Browse files Browse the repository at this point in the history
Auto-mock addons channel
  • Loading branch information
yannbf authored Feb 3, 2022
2 parents 5f3592c + 940aa34 commit 7de1226
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { combineParameters } from "@storybook/client-api";
import addons, { mockChannel } from '@storybook/addons';
import type { Story, Meta, StoryContext } from "@storybook/vue3";
import type { StoryFnVueReturnType, ContextedStory, GlobalConfig, StoriesWithPartialProps } from "./types";

import decorateStory from "./decorateStory";

let globalStorybookConfig: GlobalConfig = {};

// Some addons use the channel api to communicate between manager/preview, and this is a client only feature, therefore we must mock it.
addons.setChannel(mockChannel());

export function setGlobalConfig(config: GlobalConfig) {
globalStorybookConfig = config;
}
Expand Down

0 comments on commit 7de1226

Please sign in to comment.