How to use the @storybook/core-events.STORY_ADDED function in @storybook/core-events

To help you get started, we’ve selected a few @storybook/core-events examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github storybookjs / storybook / app / react-native / src / client / preview / components / StoryListView / index.js View on Github external
constructor(props, ...args) {
    super(props, ...args);

    this.state = {
      data: [],
      originalData: [],
    };

    this.storyAddedHandler = this.handleStoryAdded.bind(this);

    props.stories.on(Events.STORY_ADDED, this.storyAddedHandler);
  }
github storybookjs / storybook / app / react-native / src / preview / components / StoryListView / index.tsx View on Github external
componentWillUnmount() {
    const channel = addons.getChannel();
    channel.removeListener(Events.STORY_ADDED, this.handleStoryAdded);
  }
github storybookjs / storybook / app / react-native / src / preview / components / StoryListView / index.tsx View on Github external
componentDidMount() {
    const channel = addons.getChannel();
    channel.on(Events.STORY_ADDED, this.handleStoryAdded);
    channel.on(Events.SELECT_STORY, this.forceReRender);
    this.handleStoryAdded();
  }
github storybookjs / storybook / app / react-native / src / client / preview / components / StoryListView / index.js View on Github external
componentWillUnmount() {
    const { stories } = this.props;
    stories.removeListener(Events.STORY_ADDED, this.storyAddedHandler);
  }