Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props, ...args) {
super(props, ...args);
this.state = {
data: [],
originalData: [],
};
this.storyAddedHandler = this.handleStoryAdded.bind(this);
props.stories.on(Events.STORY_ADDED, this.storyAddedHandler);
}
componentWillUnmount() {
const channel = addons.getChannel();
channel.removeListener(Events.STORY_ADDED, this.handleStoryAdded);
}
componentDidMount() {
const channel = addons.getChannel();
channel.on(Events.STORY_ADDED, this.handleStoryAdded);
channel.on(Events.SELECT_STORY, this.forceReRender);
this.handleStoryAdded();
}
componentWillUnmount() {
const { stories } = this.props;
stories.removeListener(Events.STORY_ADDED, this.storyAddedHandler);
}