Skip to content

Commit

Permalink
fix: decorators typecheck at loading
Browse files Browse the repository at this point in the history
  • Loading branch information
atanasster committed Dec 3, 2020
1 parent 37d43fc commit d157bae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/store/src/serialization/load-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ export const loadStore = (store: LoadingStore, building?: boolean): Store => {
subcomponents: doc.subcomponents,
controls: doc.controls,
smartControls: doc.smartControls,
decorators: doc.decorators,
decorators: Array.isArray(doc.decorators)
? doc.decorators.filter(d => typeof d === 'function')
: undefined,
};
globalStore.docs[doc.title] = doc;
Object.keys(storeStories).forEach((storyName: string) => {
Expand All @@ -83,9 +85,7 @@ export const loadStore = (store: LoadingStore, building?: boolean): Store => {
story.id = story.id || story.name;
//storybook compat
story.controls = story.controls || (story as any).args;
if (!building) {
Object.assign(story, deepMerge(docStoryProps, story));
}
Object.assign(story, deepMerge(docStoryProps, story));
story.controls = getControls(story, doc, loadedComponents);
if (doc.title && story.id) {
const id = docStoryToId(doc.title, story.id);
Expand Down

0 comments on commit d157bae

Please sign in to comment.