Skip to content
This repository has been 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
merged 1 commit into from
Dec 2, 2022

Conversation

danielroe
Copy link
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

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