Skip to content

Commit

Permalink
Fix issue with core-events
Browse files Browse the repository at this point in the history
  • Loading branch information
Tom Coleman committed Jan 8, 2019
1 parent 5c55dd5 commit 5cfd3c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/ui/src/core/context.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';

import { STORY_CHANGED, SET_STORIES, SELECT_STORY, APPLY_SHORTCUT } from '@storybook/core-events';
import Events from '@storybook/core-events';

import initProviderApi from './init-provider-api';
import initKeyHandler from './init-key-handler';
Expand All @@ -18,6 +18,8 @@ import initVersions from './versions';

const Context = React.createContext({ api: undefined, state: getInitialState({}) });

const { STORY_CHANGED, SET_STORIES, SELECT_STORY, APPLY_SHORTCUT } = Events;

export class Provider extends Component {
static propTypes = {
navigate: PropTypes.func.isRequired,
Expand Down Expand Up @@ -79,6 +81,7 @@ export class Provider extends Component {
api.setOptions(options);
});

console.log(SET_STORIES);
api.on(SET_STORIES, data => {
api.setStories(data.stories);
});
Expand Down

0 comments on commit 5cfd3c8

Please sign in to comment.