mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-04 18:41:06 +08:00
Do not merge p if not provided, if provided, no conditional is needed
This commit is contained in:
parent
06c57aec43
commit
e87c329e90
@ -52,7 +52,7 @@ function decorateStory(getStory, decorators) {
|
||||
...p,
|
||||
parameters: {
|
||||
...context.parameters,
|
||||
...(p && p.parameters),
|
||||
...p.parameters,
|
||||
},
|
||||
}
|
||||
: context
|
||||
|
@ -44,11 +44,15 @@ export const defaultDecorateStory = (storyFn: StoryFn, decorators: DecoratorFunc
|
||||
(decorated, decorator) => (context: StoryContext = defaultContext) =>
|
||||
decorator(
|
||||
p =>
|
||||
decorated({
|
||||
...context,
|
||||
...p,
|
||||
parameters: { ...context.parameters, ...(p && p.parameters) },
|
||||
}),
|
||||
decorated(
|
||||
p
|
||||
? {
|
||||
...context,
|
||||
...p,
|
||||
parameters: { ...context.parameters, ...p.parameters },
|
||||
}
|
||||
: context
|
||||
),
|
||||
context
|
||||
),
|
||||
storyFn
|
||||
|
Loading…
x
Reference in New Issue
Block a user