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

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

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

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

Conversation

@danielroe

@danielroedanielroe commented Dec 1, 2022

Copy link
Copy Markdown
Member

🔗 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.

@danielroedanielroe added bug Something isn't working types labels Dec 1, 2022
@danielroe
danielroe requested a review from pi0December 1, 2022 11:11
@danielroedanielroe self-assigned this Dec 1, 2022
@codesandbox

Copy link
Copy Markdown

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

@pi0pi0 changed the title fix(nuxt)!: useCookie with defaults should return non-null valuefix(nuxt): useCookie with defaults should return non-null valueDec 2, 2022
pi0
pi0 approved these changes Dec 2, 2022
@pi0
pi0 merged commit c26979a into mainDec 2, 2022
@pi0
pi0 deleted the fix/revert-cookie-null branch December 2, 2022 09:45
@pi0pi0 mentioned this pull request Dec 15, 2022
6 tasks
@danielroedanielroe mentioned this pull request Jan 20, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

3.xbugSomething isn't workingtypes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@danielroe@pi0