Rename example => story

This commit is contained in:
Michael Shilman 2019-06-25 11:06:48 +08:00
parent 2dd97ad0a8
commit c546d4d516

View File

@ -283,7 +283,7 @@ export default function start(render, { decorateStory } = {}) {
);
}
const { default: meta, ...examples } = fileExports;
const { default: meta, ...stories } = fileExports;
const kindName = meta.title;
if (previousExports[filename]) {
@ -307,10 +307,10 @@ export default function start(render, { decorateStory } = {}) {
kind.addParameters(meta.parameters);
}
Object.keys(examples).forEach(key => {
const example = examples[key];
const { title = example.title || key, parameters } = example;
kind.add(title, example, parameters);
Object.keys(stories).forEach(key => {
const story = stories[key];
const { title = story.title || key, parameters } = story;
kind.add(title, story, parameters);
});
previousExports[filename] = fileExports;