Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

fix(nuxt): useCookie with defaults should return non-null value#9449

Merged
pi0 merged 1 commit intomainfrom
fix/revert-cookie-null
Dec 2, 2022
Merged

fix(nuxt): useCookie with defaults should return non-null value#9449
pi0 merged 1 commit intomainfrom
fix/revert-cookie-null

Conversation

@danielroe
Copy link
Copy Markdown
Member

@danielroe danielroe commented Dec 1, 2022

🔗 Linked issue

#8769 (comment)

❓ Type of change

  • 📖 Documentation (updates to the documentation or readme)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

This reverts the previous change in linked PR, allowing user to choose whether or not the cookie should be nullable by providing a generic type. This is a type-breaking change and should likely occur in a minor release rather than a major one.

👉 Migration

If you were relying on the default nullable behaviour, you can pass a generic instead:

- useCookie('test', () => 'something').value = null
+ useCookie<string | null>('test', () => 'something').value = null

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@danielroe danielroe added bug Something isn't working types labels Dec 1, 2022
@danielroe danielroe requested a review from pi0 December 1, 2022 11:11
@danielroe danielroe self-assigned this Dec 1, 2022
@codesandbox
Copy link
Copy Markdown

codesandbox Bot commented Dec 1, 2022

CodeSandbox logoCodeSandbox logo  Open in CodeSandbox Web Editor | VS Code | VS Code Insiders

@pi0 pi0 changed the title fix(nuxt)!: useCookie with defaults should return non-null value fix(nuxt): useCookie with defaults should return non-null value Dec 2, 2022
@pi0 pi0 merged commit c26979a into main Dec 2, 2022
@pi0 pi0 deleted the fix/revert-cookie-null branch December 2, 2022 09:45
@pi0 pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroe danielroe added the 3.x label Jan 19, 2023
@danielroe danielroe mentioned this pull request Jan 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.x bug Something isn't working types

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants