-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Issue
If I don't set the cookie in the parameters, it will disappear.
If I add this addon to a new project that doesn't have any storybooks, I'll just need to set the cookie for each storybook.
However, if I already have a lot of existing storybooks, it's a pain to set the cookie in parameters for each storybook individually (even if I bind a template, I still have to swap existing storybooks with the template, which is also a pain).
Proposal
Add preserveCookie(Boolean) as an option to the addon, so that if preserveCookie is true, no cookies are lost without setting parameters['cookie'] in each storybook.
If parameters['cookie'] exists in a particular storybook, it will cause existing cookies to be overwritten with the values in the cookie.
- Example:
addons: [{ name: 'storybook-addon-cookie', options: { preserveCookie: true } }, ...](.storybook/main.ts) - The default value of preserveCookie is true.
Contribute
I can contribute!
I've contributed to open source projects like pnpm, typeorm, summernote, etc.