Update vue decorator to mirror SB one

This commit is contained in:
Tom Coleman 2020-02-18 21:15:36 +11:00
parent 36253648e4
commit fc21e562dc

View File

@ -78,22 +78,13 @@ function decorateStory(
(decorated: StoryFn<VueConstructor>, decorator) => (context: StoryContext = defaultContext) => {
let story;
const decoratedStory = decorator(p => {
story = decorated(
p
? {
...context,
...p,
parameters: {
...context.parameters,
...p.parameters,
},
}
: context
);
return story;
}, context);
const decoratedStory = decorator(
({ parameters, ...innerContext }: StoryContext = {} as StoryContext) => {
story = decorated({ ...context, ...innerContext });
return story;
},
context
);
if (!story) {
story = decorated(context);