Skip to content

Pattern for reuse/sharing of decorators common to a group of packages? #29047

Answered by Marklb
SpanishPear asked this question in Help
Discussion options

You must be logged in to vote

I don't know if there is a recommended pattern for that, but I tend to look for patterns used for test/spec files, when I can't decide. Storybook has become the main tool I use for testing components, but even before that I thought about it this way. Most things I share are based around providing mock data or implementations, which would also be done for tests, even if I am not adding tests to the stories. So, I often group them with my shared test exports. If I had more Storybook specific shared things then maybe I wouldn't mix them with the test utilities, but I am normally sharing a mock or wrapper of something.

The way I do it normally ends up being something similar to your Solution 1,…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@SpanishPear
Comment options

Answer selected by SpanishPear
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants