Skip to content

Commit 0b95940

Browse files
fix: add a @deprecated tag to the mswDecorator (#178)
* Add an `@deprecated` JSDoc tag to the mswDecorator. Previously, this was only communicated to the user via the browser console, and so was easy to miss. I only noticed it because of reading the changelog. It'll be much more likely for users to notice this deprecation if their editor tells them that it's deprecated, so this will hopefully help ease migration. * Update packages/msw-addon/src/decorator.ts Co-authored-by: Artem Zakharchenko <[email protected]> --------- Co-authored-by: Artem Zakharchenko <[email protected]>
1 parent ec35e93 commit 0b95940

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

packages/msw-addon/src/decorator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ const deprecateMessage = deprecate(`
2121
More info: https://github.com/mswjs/msw-storybook-addon/blob/main/MIGRATION.md#mswdecorator-is-deprecated-in-favor-of-mswloader
2222
`)
2323

24+
/**
25+
* @deprecated The `mswDecorator` is deprecated and will be removed in the next release. Please use the `mswLoader` instead.
26+
* More info: https://github.com/mswjs/msw-storybook-addon/blob/ec35e9371f8a56a27220838fba798b9001ac7fad/MIGRATION.md#mswdecorator-is-deprecated-in-favor-of-mswloader
27+
*/
2428
export const mswDecorator = <Story extends (...args: any[]) => any>(
2529
storyFn: Story,
2630
context: Context

0 commit comments

Comments
 (0)